Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: I don't know which part of _WindowsConsoleIO.write() fails to handle empty bytes string, but the simplest and the most efficient way to fix this bug it to add an explicit check for zero length at the begin of this method and return Python integer 0 in this case.
The test should check that sys.stdout.buffer.write(b''), sys.stdout.buffer.write(b'') and sys.stdout.buffer.raw.write(b'') return 0 (the latter to checks should be performed only if the corresponding buffer and raw attributes exist). There are special tests for WindowsConsoleIO, it would be nice to add an explicit test here too. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31966> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com