Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f0ccfa

Browse files
author
Charles-François Natali
committed
Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
1 parent eef80b6 commit 1f0ccfa

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/asyncore.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def poll(timeout=0.0, map=None):
132132
is_w = obj.writable()
133133
if is_r:
134134
r.append(fd)
135-
if is_w:
135+
# accepting sockets should not be writable
136+
if is_w and not obj.accepting:
136137
w.append(fd)
137138
if is_r or is_w:
138139
e.append(fd)
@@ -179,7 +180,8 @@ def poll2(timeout=0.0, map=None):
179180
flags = 0
180181
if obj.readable():
181182
flags |= select.POLLIN | select.POLLPRI
182-
if obj.writable():
183+
# accepting sockets should not be writable
184+
if obj.writable() and not obj.accepting:
183185
flags |= select.POLLOUT
184186
if flags:
185187
# Only check for exceptions if object was either readable

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Core and Builtins
2727
Library
2828
-------
2929

30+
- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
31+
3032
- Issue #4376: ctypes now supports nested structures in a endian different than
3133
the parent structure. Patch by Vlad Riscutia.
3234

0 commit comments

Comments
 (0)