[Python-ideas] BufferedIO and detach

Robert Collins robertc at robertcollins.net
Sun Mar 3 12:19:36 CET 2013

There doesn't seem to be a way to safely use detach() on stdin - I'd
like to get down to the raw stream, but after calling detach(), the
initial BufferedIOReader is unusable - so you cannot retrieve any
buffered content) - and unless you detach(), you can't guarantee that
the buffer will ever be empty.

I presume I'm missing something, but if there was a read([n],
buffered_only=False) call, which you could invoke with
buffered_only=True, then it would be possible to get out of this


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

More information about the Python-ideas mailing list