Author ncoghlan
Recipients Jan Niklas Hasse, abarry, ezio.melotti, inada.naoki, lemburg, ncoghlan, r.david.murray, vstinner, yan12125
Date 2016-12-18.07:20:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482045638.07.0.579730579987.issue28180@psf.upfronthosting.co.za>
In-reply-to
Content
For folks not following the Fedora BZ issue directly, I've also attached the latest draft downstream patch here, which gives the following behaviour:

==========================

$ ./python -c "import sys; print(sys.getfilesystemencoding())"
utf-8

$ LANG=C.UTF-8 ./python -c "import sys; print(sys.getfilesystemencoding())"
utf-8

$ LANG=C ./python -c "import sys; print(sys.getfilesystemencoding())"
Python detected LC_CTYPE=C, forcing LC_ALL & LANG to C.UTF-8 (set PYTHONALLOWCLOCALE to disable this behaviour).
utf-8

$ PYTHONALLOWCLOCALE=1 LANG=C ./python -c "import sys; print(sys.getfilesystemencoding())"
Python detected LC_CTYPE=C, but PYTHONALLOWCLOCALE is set. Some libraries, applications, and operating system interfaces may not work correctly.
Py_Initialize detected LC_CTYPE=C, which limits Unicode compatibility. Some libraries and operating system interfaces may not work correctly. Use `PYTHONALLOWCLOCALE=1 LC_CTYPE=C python3` to configure a similar environment when running Python directly.
ascii
==========================

(The double warning in the last example is likely to go away by skipping the CLI level warning in that case)

The Python tests checking for the expected behaviour are signficantly longer than the C level changes needed to implement it :)
History
Date User Action Args
2016-12-18 07:20:38ncoghlansetrecipients: + ncoghlan, lemburg, vstinner, ezio.melotti, r.david.murray, inada.naoki, yan12125, abarry, Jan Niklas Hasse
2016-12-18 07:20:38ncoghlansetmessageid: <1482045638.07.0.579730579987.issue28180@psf.upfronthosting.co.za>
2016-12-18 07:20:38ncoghlanlinkissue28180 messages
2016-12-18 07:20:37ncoghlancreate