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 anthony shaw
Recipients anthony shaw
Date 2018-05-02.06:18:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525241894.06.0.682650639539.issue33405@psf.upfronthosting.co.za>
In-reply-to
Content
observing a behaviour on Python 3.7 b2 that doesn't match what's documented in PEP 538

PEP 538 states that the locale coercion behaviour can be disabled through the PYTHONCOERCECLOCALE environment variable.
I would then expect the stdin encoding to be the same as Python 3.6 when the C locale is specified with no encoding value. 

bash-3.2$ LANG=C python3.6 -c "import sys; print(sys.stdin.encoding)"
US-ASCII
bash-3.2$ LANG=C python3.7 -c "import sys; print(sys.stdin.encoding)"
utf-8
bash-3.2$ PYTHONCOERCECLOCALE=0 LANG=C python3.7 -c "import sys; print(sys.stdin.encoding)"
utf-8

LC_ALL is not set

bash-3.2$ locale
LANG="C"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Trying to dig into the reason why the env flag isn't disabling the behaviour I found some subsequent changes after the PEP which look to have broken the original implementation behaviour.

https://github.com/python/cpython/commit/9454060e84a669dde63824d9e2fcaf295e34f687
History
Date User Action Args
2018-05-02 06:18:14anthony shawsetrecipients: + anthony shaw
2018-05-02 06:18:14anthony shawsetmessageid: <1525241894.06.0.682650639539.issue33405@psf.upfronthosting.co.za>
2018-05-02 06:18:14anthony shawlinkissue33405 messages
2018-05-02 06:18:13anthony shawcreate