Message180386
| Author |
sbt |
| Recipients |
giampaolo.rodola, gvanrossum, jcea, neologix, pitrou, sbt, trent |
| Date |
2013年01月22日.13:31:10 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1358861470.65.0.64670252928.issue16507@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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: |
|