Skip to content

gh-112800: Ignore PermissionError on SubprocessTransport.close() #112803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion Lib/asyncio/base_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def close(self):

try:
self._proc.kill()
except ProcessLookupError:
except (ProcessLookupError, PermissionError):
# the process may have already exited or may be running setuid
pass

# Don't clear the _proc reference yet: _post_init() may still run
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix :mod:`asyncio` ``SubprocessTransport.close()`` not to throw
``PermissionError`` when used with setuid executables.