Module locale throws exception: unsupported locale setting

Sibylle Koczian nulla.epistola at web.de
Fri Nov 19 20:58:17 CET 2010


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



More information about the Python-list mailing list