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

Commit5804ee7

Browse files
gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (#134508)
1 parent8dbc119 commit5804ee7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎Lib/asyncio/base_subprocess.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ def close(self):
104104
forprotoinself._pipes.values():
105105
ifprotoisNone:
106106
continue
107-
proto.pipe.close()
107+
# See gh-114177
108+
# skip closing the pipe if loop is already closed
109+
# this can happen e.g. when loop is closed immediately after
110+
# process is killed
111+
ifself._loopandnotself._loop.is_closed():
112+
proto.pipe.close()
108113

109114
if (self._procisnotNoneand
110115
# has the child process finished?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix:mod:`asyncio` to not close subprocess pipes which would otherwise error out when the event loop is already closed.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp