Eryk Sun <[email protected]> added the comment:
> It's doing this now, so seems like it has been fixed
Yes. In POSIX systems since Python 3.7, if the LC_CTYPE locale is the legacy
"C" or "POSIX" locale, by default it tries to coerce LC_CTYPE to "C.UTF-8",
"C.utf8", or "UTF-8". If coercion fails or is disabled (e.g. by defining
LC_ALL), the interpreter will still use UTF-8 for the filesystem encoding if
UTF-8 mode isn't disabled. If UTF-8 mode is also disabled, then ASCII is used.
For example:
$ LC_CTYPE=C PYTHONCOERCECLOCALE= PYTHONUTF8= python -c 'import sys;
print(sys.getfilesystemencoding())'
utf-8
$ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8= python -c 'import sys;
print(sys.getfilesystemencoding())'
utf-8
$ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python -c 'import sys;
print(sys.getfilesystemencoding())'
ascii
----------
nosy: +eryksun
resolution: -> fixed
stage: needs patch -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue25867>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com