read stdout/stderr without blocking
peter at engcorp.com
Fri Sep 16 04:10:52 CEST 2005
Donn Cave wrote:
> Peter Hansen <peter at engcorp.com> wrote:
>>Jacek Pop³awski wrote:
>>>My tests showed, that it will block.
>>Not if you use non-blocking sockets, as I believe you are expected to
>>when using select().
> On the contrary, you need non-blocking sockets only if
> you don't use select. select waits until a read [write]
> would not block - it's like "if dict.has_key(x):" instead of
> "try: val = dict[x] ; except KeyError:". I suppose you
> knew that, but have read some obscure line of reasoning
> that makes non-blocking out to be necessary anyway.
No, no, I suspect I was just plain wrong. I think I felt a twinge of
suspicion even as I wrote it, but I went ahead and hit Send anyway
perhaps because I'd had two nights with little sleep (if I need an
excuse to be wrong, that is, which I don't :-) ).
> Who knows, but it certainly isn't in this case.
Thanks for straightening things out for the record.
More information about the Python-list