Author steve.dower
Recipients docs@python, eryksun, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-03-24.23:34:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490398465.74.0.349575776434.issue29898@psf.upfronthosting.co.za>
In-reply-to
Content
It's actually called "PYTHONLEGACYWINDOWSSTDIO" in Python/pylifecycle.c, which is also what PEP 528 says it should be, so this is a docs issue.

You're correct that PYTHONIOENCODING is overridden by detection of a real console, however, PYTHONIOENCODING doesn't currently set a flag anywhere, and the (required for compatibility) defaults on Windows would make it look like it's always been set to something else.

In my opinion, you should set PYTHONLEGACYWINDOWSSTDIO to indicate that even though we know the incoming encoding (Unicode from an interactive console), you don't care and you want to override it with a default value. Then use PYTHONIOENCODING to set that default value. This is most consistent with the existing use of PYTHONIOENCODING (it's the default unless you know exactly which encoding you are getting).
History
Date User Action Args
2017-03-24 23:34:25steve.dowersetrecipients: + steve.dower, paul.moore, vstinner, tim.golden, ezio.melotti, docs@python, zach.ware, eryksun
2017-03-24 23:34:25steve.dowersetmessageid: <1490398465.74.0.349575776434.issue29898@psf.upfronthosting.co.za>
2017-03-24 23:34:25steve.dowerlinkissue29898 messages
2017-03-24 23:34:25steve.dowercreate