Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.

parent 6efcbf86
...@@ -130,7 +130,8 @@ def poll(timeout=0.0, map=None): ...@@ -130,7 +130,8 @@ def poll(timeout=0.0, map=None):
is_w = obj.writable() is_w = obj.writable()
if is_r: if is_r:
r.append(fd) r.append(fd)
if is_w: # accepting sockets should not be writable
if is_w and not obj.accepting:
w.append(fd) w.append(fd)
if is_r or is_w: if is_r or is_w:
e.append(fd) e.append(fd)
...@@ -177,7 +178,8 @@ def poll2(timeout=0.0, map=None): ...@@ -177,7 +178,8 @@ def poll2(timeout=0.0, map=None):
flags = 0 flags = 0
if obj.readable(): if obj.readable():
flags |= select.POLLIN | select.POLLPRI flags |= select.POLLIN | select.POLLPRI
if obj.writable(): # accepting sockets should not be writable
if obj.writable() and not obj.accepting:
flags |= select.POLLOUT flags |= select.POLLOUT
if flags: if flags:
# Only check for exceptions if object was either readable # Only check for exceptions if object was either readable
......
...@@ -22,6 +22,8 @@ What's New in Python 3.1.4? ...@@ -22,6 +22,8 @@ What's New in Python 3.1.4?
Library Library
------- -------
- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
- Issue #12009: Fixed regression in netrc file comment handling. - Issue #12009: Fixed regression in netrc file comment handling.
Extension Modules Extension Modules
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment