Nick Coghlan <ncogh...@gmail.com> added the comment:

The actual functional error is that the following will currently give different 
outputs on Fedora and CentOS 7, whereas in the original PEP 538 implementation 
it would always print "C", even if locale coercion would otherwise normally 
work on your current platform:

    LC_CTYPE=C PYTHONCOERCECLOCALE=0 python3 -E -c 'import os; 
print(os.env["LC_CTYPE"])'


As per the comment that was deleted in 
https://github.com/python/cpython/commit/9454060e84a669dde63824d9e2fcaf295e34f687#diff-8c018c3ada66d06c8e101e47a313c2c7,
 that was an intentional behaviour to allow developers testing scripts that are 
invoked using -E and -I to pretend that their local C.UTF-8 locale didn't exist 
when trying to reproducing behaviour otherwise seen only when locale coercion 
fails due to the lack of a suitable coercion target.

I'm working on an alternate PR that restores that aspect of the original 
behaviour, while preserving all the other improvements you made (such as 
ensuring that emitting the warning gets delayed until after the C level stderr 
is properly initialised)

----------

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

Reply via email to