Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:not': 0.03; 'preferred.': 0.05; 'here?': 0.09; 'pgp': 0.09; 'python': 0.11; '(),': 0.16; 'fingerprint:': 0.16; 'fruit': 0.16; 'reliably': 0.16; 'reproduce': 0.16; 'select.': 0.16; 'subject:ready': 0.16; 'thanks,': 0.17; 'result.': 0.19; 'header:User-Agent:1': 0.23; 'idea': 0.28; 'subject:) ': 0.29; "i'm": 0.30; 'anyone': 0.31; 'linux': 0.33; 'running': 0.33; 'problem': 0.35; 'skip:s 30': 0.35; 'but': 0.35; 'seconds': 0.37; 'wrong': 0.37; '(i.e.,': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'situation': 0.65; '100%': 0.77; 'condition.': 0.84; 'flies': 0.84; 'encrypted': 0.91; 'race': 0.95 From: Nikolaus Rath To: python-list@python.org Subject: select(sock) indicates not-ready, but sock.recv does not block Mail-Copies-To: never Mail-Followup-To: python-list@python.org Date: Sun, 16 Feb 2014 22:35:22 -0800 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392618926 news.xs4all.nl 2839 [2001:888:2000:d::a6]:47863 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66589 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 condition. The behavor is 100% reproducible, the program is single threaded, and even waiting for 10 seconds before the select() call does not change the result. I'm running Python 3.3.3 under Linux 3.12. Has anyone an idea what might be going wrong here? Thanks, -Nikolaus --=20 Encrypted emails preferred. PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2= =AB