Module locale throws exception: unsupported locale setting

S

Sibylle Koczian

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
 
N

Ned Deily

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.
 
S

Sibylle Koczian

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,010
Latest member
MerrillEic

Latest Threads

Top