]> granicus.if.org Git - python/commitdiff
Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
authorCharles-François Natali <neologix@free.fr>
Thu, 14 Jul 2011 17:49:02 +0000 (19:49 +0200)
committerCharles-François Natali <neologix@free.fr>
Thu, 14 Jul 2011 17:49:02 +0000 (19:49 +0200)
Lib/asyncore.py
Misc/NEWS

index 1a623db94bbcad9bc4f396dbcae4296bfe34bd2a..35db3875d1e84a857e636b345df6edecac866e79 100644 (file)
@@ -132,7 +132,8 @@ def poll(timeout=0.0, map=None):
             is_w = obj.writable()
             if is_r:
                 r.append(fd)
-            if is_w:
+            # accepting sockets should not be writable
+            if is_w and not obj.accepting:
                 w.append(fd)
             if is_r or is_w:
                 e.append(fd)
@@ -179,7 +180,8 @@ def poll2(timeout=0.0, map=None):
             flags = 0
             if obj.readable():
                 flags |= select.POLLIN | select.POLLPRI
-            if obj.writable():
+            # accepting sockets should not be writable
+            if obj.writable() and not obj.accepting:
                 flags |= select.POLLOUT
             if flags:
                 # Only check for exceptions if object was either readable
index 7271ef901edb978621d794fc6c550d1d14088e70..4f1f1cf0617685161de3146d9db51944648bed33 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -30,6 +30,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
+
 - Issue #4376: ctypes now supports nested structures in a endian different than
   the parent structure. Patch by Vlad Riscutia.