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 ncoghlan
Recipients barry, methane, ncoghlan, vstinner
Date 2017-06-17.14:52:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497711179.39.0.224581746421.issue30565@psf.upfronthosting.co.za>
In-reply-to
Content
By having the warnings always compiled in, but off by default, "PYTHONCOERCECLOCALE=warn" becomes a debugging tool for integration failures that we (or end users) suspect might be due to the locale coercion behaviour. It's essentially an even more esoteric variant of tools like "PYTHONINSPECT=1", "python -X faulthandler", "python -v", etc.

I already learned something myself based on updating the test cases to cover the opt-in warning model: I initially thought that when we set "LC_ALL=C" we'd get *both* warnings, but we don't (at least with glibc).

My working theory is that setting 'LC_ALL=C' causes 'setlocale(LC_CTYPE, "C.UTF-8")' to fail, even if there's otherwise a C.UTF-8 locale available. (I haven't conclusively proven that theory, but it's the most likely point for the locale coercion to be implicitly bypassed)
History
Date User Action Args
2017-06-17 14:52:59ncoghlansetrecipients: + ncoghlan, barry, vstinner, methane
2017-06-17 14:52:59ncoghlansetmessageid: <1497711179.39.0.224581746421.issue30565@psf.upfronthosting.co.za>
2017-06-17 14:52:59ncoghlanlinkissue30565 messages
2017-06-17 14:52:58ncoghlancreate