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 eryksun
Recipients eryksun, iritkatriel, ncoghlan, r.david.murray, sejvlond, vstinner
Date 2021-08-26.11:55:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629978903.15.0.870392750857.issue25867@roundup.psfhosted.org>
In-reply-to
Content
> 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
History
Date User Action Args
2021-08-26 11:55:03eryksunsetrecipients: + eryksun, ncoghlan, vstinner, r.david.murray, sejvlond, iritkatriel
2021-08-26 11:55:03eryksunsetmessageid: <1629978903.15.0.870392750857.issue25867@roundup.psfhosted.org>
2021-08-26 11:55:03eryksunlinkissue25867 messages
2021-08-26 11:55:03eryksuncreate