[Python-ideas] BufferedIO and detach

Benjamin Peterson benjamin at python.org
Sun Mar 3 17:16:34 CET 2013

Robert Collins <robertc at ...> writes:

> 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.

Presumably if you call it before anyone else has had a chance to read from it,
you should be okay.

More information about the Python-ideas mailing list