STINNER Victor <vstin...@redhat.com> added the comment:

Since this bug has been reported, locale.localeconv() has been fixed in 
bpo-31900 to temporarily set LC_CTYPE to LC_NUMERIC to decode numeric fields of 
localeconv() from the proper encoding. I guess that a similar fix can be 
applied to locale.nl_langinfo(): set LC_CTYPE to LC_NUMERIC if the parameter is 
a numeric field.

I only knew locale.nl_langinfo(locale.CODESET). I didn't know that this 
function accepted other arguments :-)

I even wrote an article about these locale bugs :-)
https://github.com/python/cpython/pull/5191

See also bpo-35697: "decimal: formatter error if LC_NUMERIC uses a different 
encoding than LC_CTYPE".

----------
nosy: +vstinner

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue25812>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to