From: Charles-François Natali Date: Thu, 14 Jul 2011 17:49:02 +0000 (+0200) Subject: Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2659140a5d0fbace2826320c0c3130e356c3c94b;p=python Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. --- diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 1a623db94b..35db3875d1 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -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 diff --git a/Misc/NEWS b/Misc/NEWS index 7271ef901e..4f1f1cf061 100644 --- 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.