[Python-ideas] BufferedIO and detach

Robert Collins robertc at robertcollins.net
Mon Mar 4 22:11:12 CET 2013


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. Doing it by command line
arguments to Python works as long as a command is always byte
orientated (or never) - but thats a very big hammer.

-Rob

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Cloud Services



More information about the Python-ideas mailing list