Skip to content

gh-86427: Determine the stdio encoding for every standard stream on Windows - #155416

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-86427-per-stream-encoding
Open

gh-86427: Determine the stdio encoding for every standard stream on Windows#155416
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-86427-per-stream-encoding

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

PyConfig.stdio_encoding is now left undefined in the legacy Windows stdio mode, and the encoding of every standard stream is determined from the device it is connected to. sys.stdin.encoding and sys.stdout.encoding can therefore differ, and a redirected stream uses the locale encoding.

This makes the member optional, which @vstinner objected to in the issue. #155415 is the minimal fix which is suitable for backporting.

It was the ANSI code page instead of the encoding of the device the stream
is connected to, as in 3.7.

The stdio encoding is now left undefined in this mode and determined for
every standard stream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant