Module locale throws exception: unsupported locale setting

Discussion in 'Python' started by Sibylle Koczian, Nov 19, 2010.

  1. Hello,

    on a german Windows installation I get problems with locale. If I run
    that module as a script from a command window this is the output:

    C:\Python31\Lib>locale.py
    Locale aliasing:

    Locale defaults as determined by getdefaultlocale():
    ------------------------------------------------------------------------
    Language: de_DE
    Encoding: cp1252

    Locale settings on startup:
    ------------------------------------------------------------------------
    LC_NUMERIC ...
    Language: (undefined)
    Encoding: (undefined)

    LC_MONETARY ...
    Language: (undefined)
    Encoding: (undefined)

    LC_COLLATE ...
    Language: (undefined)
    Encoding: (undefined)

    LC_CTYPE ...
    Language: (undefined)
    Encoding: (undefined)

    LC_TIME ...
    Language: (undefined)
    Encoding: (undefined)


    Locale settings after calling resetlocale():
    ------------------------------------------------------------------------
    Traceback (most recent call last):
    File "C:\Python31\Lib\locale.py", line 1798, in <module>
    _print_locale()
    File "C:\Python31\Lib\locale.py", line 1761, in _print_locale
    resetlocale()
    File "C:\Python31\Lib\locale.py", line 537, in resetlocale
    _setlocale(category, _build_localename(getdefaultlocale()))
    locale.Error: unsupported locale setting

    C:\Python31\Lib>

    This is Windows 7, 64 bit, Python 3.1.2. Same behavior on another
    Windows machine with Python 2.7 (Windows XP, 32 bit).

    On Linux, using UTF-8 as system character set and Python 2.6, 2.6.5 or
    3.1.2, no problems using locale, running the module as a script gives no
    exception but the expected output. So I suppose it's either an OS
    problem or connected with the encoding.

    I've looked into bugs.python.org, but found only vaguely similar issues.
    Should I open a new one?

    Thank you for help,
    Sibylle
     
    Sibylle Koczian, Nov 19, 2010
    #1
    1. Advertising

  2. Sibylle Koczian

    Ned Deily Guest

    In article <ic6ksr$n0k$03$-online.com>,
    Sibylle Koczian <> wrote:
    > on a german Windows installation I get problems with locale. If I run
    > that module as a script from a command window this is the output:
    >
    > C:\Python31\Lib>locale.py
    > Locale aliasing:
    >
    > Locale defaults as determined by getdefaultlocale():
    > ------------------------------------------------------------------------
    > Language: de_DE
    > Encoding: cp1252
    >
    > Locale settings on startup:
    > ------------------------------------------------------------------------
    > LC_NUMERIC ...
    > Language: (undefined)
    > Encoding: (undefined)
    >
    > LC_MONETARY ...
    > Language: (undefined)
    > Encoding: (undefined)
    >
    > LC_COLLATE ...
    > Language: (undefined)
    > Encoding: (undefined)
    >
    > LC_CTYPE ...
    > Language: (undefined)
    > Encoding: (undefined)
    >
    > LC_TIME ...
    > Language: (undefined)
    > Encoding: (undefined)
    >
    >
    > Locale settings after calling resetlocale():
    > ------------------------------------------------------------------------
    > Traceback (most recent call last):
    > File "C:\Python31\Lib\locale.py", line 1798, in <module>
    > _print_locale()
    > File "C:\Python31\Lib\locale.py", line 1761, in _print_locale
    > resetlocale()
    > File "C:\Python31\Lib\locale.py", line 537, in resetlocale
    > _setlocale(category, _build_localename(getdefaultlocale()))
    > locale.Error: unsupported locale setting
    >
    > C:\Python31\Lib>
    >
    > This is Windows 7, 64 bit, Python 3.1.2. Same behavior on another
    > Windows machine with Python 2.7 (Windows XP, 32 bit).
    >
    > On Linux, using UTF-8 as system character set and Python 2.6, 2.6.5 or
    > 3.1.2, no problems using locale, running the module as a script gives no
    > exception but the expected output. So I suppose it's either an OS
    > problem or connected with the encoding.
    >
    > I've looked into bugs.python.org, but found only vaguely similar issues.
    > Should I open a new one?


    There have been a lot of changes going into Python 3.2, currently in
    alpha testing, in the areas of encodings and how they affect the
    interfaces to/from the various platform operating systems Python 3 runs
    on. It would be very useful if you could try the same test with the
    most recent Python 3.2 alpha
    (http://www.python.org/download/releases/3.2/) and, if the problem
    persists there, open an issue about it.

    --
    Ned Deily,
     
    Ned Deily, Nov 19, 2010
    #2
    1. Advertising

  3. Am 19.11.2010 21:27, schrieb Ned Deily:
    >
    > There have been a lot of changes going into Python 3.2, currently in
    > alpha testing, in the areas of encodings and how they affect the
    > interfaces to/from the various platform operating systems Python 3 runs
    > on. It would be very useful if you could try the same test with the
    > most recent Python 3.2 alpha
    > (http://www.python.org/download/releases/3.2/) and, if the problem
    > persists there, open an issue about it.
    >


    Done. No change with 3.2a4, so I opened issue 10466.

    Thank you,
    Sibylle
     
    Sibylle Koczian, Nov 20, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Miller
    Replies:
    4
    Views:
    13,395
    Chris Smith
    Nov 22, 2003
  2. Maurice Hulsman
    Replies:
    1
    Views:
    1,856
    Guus Bosman
    Jul 25, 2004
  3. robert
    Replies:
    3
    Views:
    382
    Leo Kislov
    Nov 6, 2006
  4. Replies:
    2
    Views:
    337
  5. Vlastimil Brom
    Replies:
    0
    Views:
    956
    Vlastimil Brom
    Dec 9, 2010
Loading...

Share This Page