[Python-ideas] BufferedIO and detach

Antoine Pitrou solipsis at pitrou.net
Mon Mar 4 22:15:38 CET 2013


On Tue, 5 Mar 2013 10:17:11 +1300
Robert Collins
<robertc at robertcollins.net> wrote:
> 
> sys.stdin - starts in blocking mode. How do you convert it to
> non-blocking mode? Portably? Now, how do you convert it to
> non-blocking mode when you don't know that it is fd 1, and instead you
> just have a stream (TextIOWrapper or BufferedReader or even a RawIO
> instance) ?

How about the fileno() method?






More information about the Python-ideas mailing list