Visitar URL original
[3.11] GH-88050: fix race in closing subprocess pipe in asyncio (GH-97951) by miss-islington · Pull Request #97978 · python/cpython · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
GH-88050: fix race in closing subprocess pipe in asyncio (GH-97951)
Check for None when iterating over `self._pipes.values()`.
(cherry picked from commit e2e6b95)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
  • Loading branch information
kumaraditya303 authored and miss-islington committed Oct 6, 2022
commit 2e5886a4db57a15324ea023c61912d3976c2cebd
4 changes: 3 additions & 1 deletion Lib/asyncio/base_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ def _process_exited(self, returncode):
self._proc.returncode = returncode
self._call(self._protocol.process_exited)
for p in self._pipes.values():
p.pipe.close()
if p is not None:
p.pipe.close()

self._try_finish()

async def _wait(self):
Expand Down