
March 4, 2013
9:12 p.m.
On Tue, 5 Mar 2013 10:11:12 +1300 Robert Collins <robertc@robertcollins.net> wrote:
On 4 March 2013 23:47, Antoine Pitrou <solipsis@pitrou.net> wrote:
As Guido noted, you actually have multiple layers of buffering to contend with - for a text stream, you may have already decoded characters and partially decoded data in the codec's internal buffer, in addition to any data in the IO buffer.
I'd prefer if TextIOWrapper was totally unsupported in that context.
The problem is that sys.stdin and sys.stdout default to TextIOWrappers, and handling protocols requires bytes, so having a way to drop down to bytes is very convenient.
Why do you want to drop to bytes *after* having already buffered stuff in sys.{stdin,stdout}? Regards Antoine.