Re: select(sock) indicates not-ready, but sock.recv does not block

2014-02-17 Thread Nikolaus Rath
Nikolaus Rath writes: > Hello, > > I have a problem with using select. I can reliably reproduce a situation > where select.select((sock.fileno(),), (), (), 0) returns ((),(),()) > (i.e., no data ready for reading), but an immediately following > sock.recv() returns data without blocking. [...] Tu

Re: select(sock) indicates not-ready, but sock.recv does not block

2014-02-17 Thread Roy Smith
In article , Nikolaus Rath wrote: > Hello, > > I have a problem with using select. I can reliably reproduce a situation > where select.select((sock.fileno(),), (), (), 0) returns ((),(),()) > (i.e., no data ready for reading), but an immediately following > sock.recv() returns data without bloc

Re: select(sock) indicates not-ready, but sock.recv does not block

2014-02-16 Thread Chris Angelico
On Mon, Feb 17, 2014 at 5:35 PM, Nikolaus Rath wrote: > Hello, > > I have a problem with using select. I can reliably reproduce a situation ... Can you reproduce it with a reasonably short amount of code? If so, please post it. > I'm running Python 3.3.3 under Linux 3.12. Do you mean Linux kern

select(sock) indicates not-ready, but sock.recv does not block

2014-02-16 Thread Nikolaus Rath
Hello, I have a problem with using select. I can reliably reproduce a situation where select.select((sock.fileno(),), (), (), 0) returns ((),(),()) (i.e., no data ready for reading), but an immediately following sock.recv() returns data without blocking. I am pretty sure that this is not a race c