Richard Oudkerk added the comment:
It appears that Linux's "spurious readiness notifications" are a deliberate
deviation from the POSIX standard. (They are mentioned in the BUGS section of
the man page for select.)
Should I just apply the following patch to the default branch?
diff -r 3ef7f1fe286c tulip/events_test.py
--- a/tulip/events_test.py Mon Jan 21 18:55:29 2013 -0800
+++ b/tulip/events_test.py Tue Jan 22 12:09:21 2013 +0000
@@ -200,7 +200,12 @@
r, w = unix_events.socketpair()
bytes_read = []
def reader():
- data = r.recv(1024)
+ try:
+ data = r.recv(1024)
+ except BlockingIOError:
+ # Spurious readiness notifications are possible
+ # at least on Linux -- see man select.
+ return
if data:
bytes_read.append(data)
else:
@@ -218,7 +223,12 @@
r, w = unix_events.socketpair()
bytes_read = []
def reader():
- data = r.recv(1024)
+ try:
+ data = r.recv(1024)
+ except BlockingIOError:
+ # Spurious readiness notifications are possible
+ # at least on Linux -- see man select.
+ return
if data:
bytes_read.append(data)
else:
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16507>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com