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

R. David Murray report at bugs.python.org
Mon Nov 22 03:13:24 CET 2010


R. David Murray <rdmurray at bitdance.com> added the comment:

It is unfunny that your program fails on Windows.

Yes it is the same bug, since calendar calls getdefaultlocale.

Issue 1080864 makes very interesting reading in this context.  Clearly Martin is right, yet the OP seems to find the current behavior of getdefaultencoding (returning the more standard locale name rather than Windows unique values) useful.

It is an interesting question what can be done about this.  Clearly resetlocale is non-functional on Windows, and getdefaultlocale is of questionable utility.  At the very least these limitations need to be documented.

Your application bug, however, can probably be addressed by fixing calendar to not use getdefaultencoding.  We should open a new bug for that, though.

----------
nosy: +loewis
title: locale.py resetlocale throws exception on Windows -> locale.py resetlocale throws exception on Windows (getdefaultlocale returns value not usable in setlocale)

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10466>
_______________________________________


More information about the Python-bugs-list mailing list