Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Module locale throws exception: unsupported locale setting

Reply
Thread Tools

Module locale throws exception: unsupported locale setting

 
 
Sibylle Koczian
Guest
Posts: n/a
 
      11-19-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
 
Reply With Quote
 
 
 
 
Ned Deily
Guest
Posts: n/a
 
      11-19-2010
In article <ic6ksr$n0k$03$(E-Mail Removed)-online.com>,
Sibylle Koczian <(E-Mail Removed)> 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,
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
Sibylle Koczian
Guest
Posts: n/a
 
      11-20-2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: ***locale.Error: unsupported locale setting*** Vlastimil Brom Python 0 12-09-2010 11:52 PM
Create C++ std::locale without changing C locale dertopper@web.de C++ 4 08-26-2008 01:15 PM
Erronous "unsupported locale setting" ? robert Python 3 11-06-2006 08:29 PM
i18n problem, involving Locale.getDisplayLanguage and Locale.getDisplayCountry Maurice Hulsman Java 1 07-25-2004 06:11 PM
locale.nl_langinfo(RADIXCHAR) vs locale.localeconv()['decimal_point'] Jeff Epler Python 2 08-31-2003 02:18 PM



Advertisments