[issue10466] locale.py resetlocale throws exception on Windows (getdefaultlocale returns value not usable in setlocale)

Marc-Andre Lemburg report at bugs.python.org
Tue Nov 23 15:15:27 CET 2010

Marc-Andre Lemburg <mal at egenix.com> added the comment:

R. David Murray wrote:
> R. David Murray <rdmurray at bitdance.com> added the comment:
> I had a report from a user on IRC during the bug weekend that they could not reproduce the failure on windows.  So it may be dependent on the windows version.  That doesn't answer your question of why it hasn't come up before, though, since my tests were done on XP.

Some research shows that the MS VCRT uses non-ISO locale names
for setlocale():


and it doesn't support the ISO style locale namings, even though
the setlocale() page says "The set of available languages, country/region codes, and code pages
includes all those supported by the Win32 NLS API" and the Win32
API does support the ISO names:


I'll have to check whether Vista also shows this behavior. On
Win XP the setlocale() API doesn't accept ISO language names;
I can confirm that. It only accepts the fully written out
form described on the above pages.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list