Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita623e42

Browse files
committed
Fixgh-127529: Correct asyncio.BaseSelectorEventLoop._accept_connection's behaviour for handling ConnectionAbortedError
1 parentc430376 commita623e42

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎Lib/asyncio/selector_events.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,13 @@ def _accept_connection(
180180
logger.debug("%r got a new connection from %r: %r",
181181
server,addr,conn)
182182
conn.setblocking(False)
183-
except (BlockingIOError,InterruptedError,ConnectionAbortedError):
184-
# Early exit because the socket accept buffer is empty.
185-
returnNone
183+
exceptConnectionAbortedError:
184+
# Discard connections that were aborted before accept().
185+
continue
186+
except (BlockingIOError,InterruptedError):
187+
# Early exit because of a signal or
188+
# the socket accept buffer is empty.
189+
return
186190
exceptOSErrorasexc:
187191
# There's nowhere to send the error, so just log it.
188192
ifexc.errnoin (errno.EMFILE,errno.ENFILE,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp