From: Charles-François Natali Date: Thu, 14 Jul 2011 17:53:38 +0000 (+0200) Subject: Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. X-Git-Tag: v3.1.5rc1~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e22813067e4f62629a9c24947c29a55861fb05f1;p=thirdparty%2FPython%2Fcpython.git Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. --- diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 00464a9427ba..3f0d2d365ca6 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -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 diff --git a/Misc/NEWS b/Misc/NEWS index 1e98768a7641..63d5c24e6ef1 100644 --- 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