Closed clbarnes closed 2 years ago
Hi @clbarnes, do you have an example where this causes a problem?
No particular examples - does this inconsistency solve any problems itself? The default python source encoding is UTF-8, but other encodings are allowed, so they should probably both return bytes
, I guess?
This has been fixed in 2.6.0, stdin is now read as bytes.
sys.stdin.read()
reads a UTF-8 string, but a file is opened in binary mode (and therefore readsbytes
). Either bytes should be read fromsys.stdin.buffer
, or the file should be opened in text mode.