]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
authorCharles-François Natali <neologix@free.fr>
Thu, 14 Jul 2011 18:00:49 +0000 (20:00 +0200)
committerCharles-François Natali <neologix@free.fr>
Thu, 14 Jul 2011 18:00:49 +0000 (20:00 +0200)
Lib/asyncore.py
Misc/NEWS

index d6476069be0e879fd7942260ae65044a9d78c5ba..e6998157499e1211505d56655afd1dd4f345a0e6 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 a206a17f127b88c7c00890565189b0eac9192fd6..18c79a023326c5084e26475890ba50f8f4c8bd06 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -225,6 +225,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.