readline() blocks after select() says there's data??
Richard Cook
wealthychef at mac.com
Fri Mar 15 13:23:42 EST 2002
That's a good point. My actual problem turns out that I had the
first two parameters to select.select() reversed, though. :-|
At 10:57 AM -0600 3/15/02, Skip Montanaro wrote:
> Rich> I don't really need select to block. I just want it to be
> Rich> accurate. If it returns a file object in the list of things which
> Rich> are available, why should then readline() block on it?
>
>Remember that select() is lower level than readline(). As someone else
>pointed out, select() may return because there is data available, but it
>makes no promises about what that data is. Calling readline() may then hang
>waiting for other conditions (presence of a newline in the input, for
>example).
>
>--
>Skip Montanaro (skip at pobox.com - http://www.mojam.com/)
--
More information about the Python-list
mailing list