David-Sarah Hopwood <david-sa...@jacaranda.org> added the comment: I wrote: > The only caveat would be that if you write a partial line to the buffer > object (or if you set the buffer object to be fully buffered and write to > it), and then write to the text stream, the buffer wouldn't be flushed before > the text is written.
Actually it looks like that already happens (because the sys.std{out,err} TextIOWrappers are line-buffered separately to their underlying buffers), so it would not be an incompatibility: $ python3 -c 'import sys; sys.stdout.write("foo"); sys.stdout.buffer.write(b"bar"); sys.stdout.write("baz\n")' barfoobaz ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1602> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com