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 vstinner
Recipients barry, ncoghlan, vstinner
Date 2017-06-14.14:27:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497450434.17.0.597349991999.issue30565@psf.upfronthosting.co.za>
In-reply-to
Content
I wrote a PR to remove PEP 538 warnings:
https://github.com/python/cpython/pull/2186

Reference (unpatched):

haypo@selma$ env -i LC_ALL=C ./python -c "import locale; print(locale.getpreferredencoding())"
Python runtime initialized with LC_CTYPE=C (a locale with default ASCII encoding), which may cause Unicode compatibility problems. Using C.UTF-8, C.utf8, or UTF-8 (if available) as alternative Unicode-compatible locales is recommended.
ANSI_X3.4-1968

haypo@selma$ env -i LC_CTYPE=C ./python -c "import locale; print(locale.getpreferredencoding())"
Python detected LC_CTYPE=C: LC_CTYPE coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).
UTF-8

haypo@selma$ env -i LC_ALL=C ./python -c "import locale; print(locale.getpreferredencoding())"
Python runtime initialized with LC_CTYPE=C (a locale with default ASCII encoding), which may cause Unicode compatibility problems. Using C.UTF-8, C.utf8, or UTF-8 (if available) as alternative Unicode-compatible locales is recommended.
ANSI_X3.4-1968


With my change:

haypo@selma$ env -i ./python -c "import locale; print(locale.getpreferredencoding())"
UTF-8

haypo@selma$ env -i LC_CTYPE=C ./python -c "import locale; print(locale.getpreferredencoding())"
UTF-8

haypo@selma$ env -i LC_ALL=C ./python -c "import locale; print(locale.getpreferredencoding())"
ANSI_X3.4-1968
History
Date User Action Args
2017-06-14 14:27:14vstinnersetrecipients: + vstinner, barry, ncoghlan
2017-06-14 14:27:14vstinnersetmessageid: <1497450434.17.0.597349991999.issue30565@psf.upfronthosting.co.za>
2017-06-14 14:27:14vstinnerlinkissue30565 messages
2017-06-14 14:27:14vstinnercreate