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, izbyshev, methane, paul.moore, steve.dower, tim.golden, u36959, vstinner, zach.ware
Date 2020-12-23.02:50:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608691845.23.0.286820757202.issue42707@roundup.psfhosted.org>
In-reply-to
Content
> When there is no console, stdio should use the default textio 
> encoding that is ANSI for now.

stdin, stdout, and stderr are special and can be special cased because they're used implicitly for IPC. They've always been acknowledged as special by the existence of PYTHONIOENCODING. I think if Python is going to change its policy for standard I/O, along the lines of what I think you've been arguing in favor of for months now, it should commit to (almost) consistently using the console input and output code pages for the standard I/O encoding in Windows, with UTF-8 as the default when there is no console session, and with the exception that UTF-8 is used for console files. To get legacy behavior, set PYTHONLEGACYWINDOWSSTDIO, which will use the console code pages for console standard I/O and otherwise use the process active code page for standard I/O.

The default encoding for open() would still be the process active code page from GetACP(), and the recommendation should be for scripts to use an explicit `encoding`.
History
Date User Action Args
2020-12-23 02:50:45eryksunsetrecipients: + eryksun, paul.moore, vstinner, tim.golden, methane, zach.ware, steve.dower, izbyshev, u36959
2020-12-23 02:50:45eryksunsetmessageid: <1608691845.23.0.286820757202.issue42707@roundup.psfhosted.org>
2020-12-23 02:50:45eryksunlinkissue42707 messages
2020-12-23 02:50:44eryksuncreate