This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients cstratak, lemburg, serhiy.storchaka, skrah, vstinner
Date 2018-01-15.13:13:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Ok, it seems that the C setlocale() itself does not follow the conventions set forth for environment variables:

(see the example at the bottom)

So the behavior shown by Python's setlocale() is fine.

However, that still doesn't magically make this work:

locale.setlocale(locale.LC_ALL, 'C.UTF-8')
locale.setlocale(locale.LC_NUMERIC, 'fr_FR.ISO8859-1')

If LC_NUMERIC uses a different encoding than LC_ALL, there's really no surprise in having numeric formatting fail. localeconv() will output the set encoding for the numeric string conversion and Python will decode this using the locale encoding set by LC_ALL. If those two are different, you run into problems.

I would not consider this a bug in Python, but rather in the locale settings passed to setlocale().
Date User Action Args
2018-01-15 13:13:44lemburgsetrecipients: + lemburg, vstinner, skrah, serhiy.storchaka, cstratak
2018-01-15 13:13:44lemburgsetmessageid: <>
2018-01-15 13:13:44lemburglinkissue31900 messages
2018-01-15 13:13:44lemburgcreate