]> 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:53:38 +0000 (19:53 +0200)
committerCharles-François Natali <neologix@free.fr>
Thu, 14 Jul 2011 17:53:38 +0000 (19:53 +0200)
Lib/asyncore.py
Misc/NEWS

index 00464a9427ba701e7982736cdf8c3d85c9cad05a..3f0d2d365ca6537acea551cd10e689a625ed8458 100644 (file)
@@ -130,7 +130,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)
@@ -177,7 +178,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 1e98768a76410827cc9a7168ed589ff825150d29..63d5c24e6ef18a8f66462b7f71c13390c1ae8511 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,8 @@ What's New in Python 3.1.4?
 Library
 -------
 
+- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
+
 - Issue #12009: Fixed regression in netrc file comment handling.
 
 Extension Modules