[issue504219] locale.resetlocale is broken

Nick Coghlan report at bugs.python.org
Tue May 9 05:49:54 EDT 2017


Nick Coghlan added the comment:

Trying to come up with a short LC_MONETARY example for PEP 538, I just ran into what seems to be a related problem with locale.resetlocale(), which is that it doesn't work properly for categories other than LC_CTYPE: locale.getdefaultlocale() doesn't let you say which category you're actually interested in, so even if you specific a category for resetlocale(), it's going to look at the LC_CTYPE setting, *NOT* the one for the category you're interested in.


So perhaps a suitable design change here would be to update resetlocale() to just pass an empty string (letting the underlying platform API call figure out the right default), rather than passing the result of locale.getdefaultlocale()?

----------
nosy: +ncoghlan

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


More information about the Python-bugs-list mailing list