Nick Coghlan added the comment:

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)

----------

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

Reply via email to