[Python-ideas] BufferedIO and detach

Antoine Pitrou solipsis at pitrou.net
Mon Mar 4 22:12:01 CET 2013

On Tue, 5 Mar 2013 10:11:12 +1300
Robert Collins
<robertc at robertcollins.net> wrote:
> On 4 March 2013 23:47, Antoine Pitrou <solipsis at 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}?



More information about the Python-ideas mailing list