[issue1602] windows console doesn't print or input Unicode

Glenn Linderman report at bugs.python.org
Sat Mar 26 02:45:12 CET 2011

Glenn Linderman <v+python at g.nevcal.com> added the comment:

David-Sarah said:
In any case, given that the buffer of the initial std{out,err} will always be a BufferedWriter object (since .buffer is readonly), it would be possible for the TextIOWriter to test a dirty flag in the BufferedWriter, in order to check efficiently whether the buffer needs flushing on each write. I've looked at the implementation complexity cost of this, and it doesn't seem too bad.

So if flush checks that bit, maybe TextIOWriter could just call buffer.flush, and it would be fast if clean and slow if dirty?  Calling it at the beginning of a Text level write, that is, which would let the char-at-a-time calls to buffer.write be fast.

And I totally agree with msg132191


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list