Skip to content

gh-110036: multiprocessing Popen.terminate() catches PermissionError - #110037

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:mp_popen_terminate
Sep 29, 2023
Merged

gh-110036: multiprocessing Popen.terminate() catches PermissionError#110037
vstinner merged 1 commit into
python:mainfrom
vstinner:mp_popen_terminate

Conversation

@vstinner

@vstinnervstinner commented Sep 28, 2023

Copy link
Copy Markdown
Member

On Windows, multiprocessing Popen.terminate() now catchs PermissionError and get the process exit code. If the process is still running, raise again the PermissionError. Otherwise, the process terminated as expected: store its exit code.

…rror
On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
@vstinnervstinner added awaiting review 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels Sep 28, 2023
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 0ed6e0b 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 28, 2023
@AlexWaygoodAlexWaygood changed the title gh-110036: multiprocessing Popen.terminate() catchs PermissionErrorgh-110036: multiprocessing Popen.terminate() catches PermissionErrorSep 28, 2023
@vstinner

Copy link
Copy Markdown
MemberAuthor

buildbot/ARM Raspbian PR

It failed with: FAIL: test_wait_integer (test.test_multiprocessing_spawn.test_misc.TestWait.test_wait_integer).

Well, that's unrelated, my code should be specific to Windows.

FAIL: test_wait_integer (test.test_multiprocessing_spawn.test_misc.TestWait.test_wait_integer)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/lib/buildbot/workers/pull_request.gps-raspbian.nondebug/build/Lib/test/_test_multiprocessing.py", line 5038, in test_wait_integer
self.assertTrue(sem.acquire(timeout=20))
AssertionError: False is not true

@vstinner
vstinner merged commit bd4518c into python:mainSep 29, 2023
@vstinner
vstinner deleted the mp_popen_terminate branch September 29, 2023 00:41
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 29, 2023
…Error (pythonGH-110037)
On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
(cherry picked from commit bd4518c)
Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 29, 2023
…Error (pythonGH-110037)
On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
(cherry picked from commit bd4518c)
Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app

Copy link
Copy Markdown

GH-110064 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only security fixes label Sep 29, 2023
@bedevere-app

Copy link
Copy Markdown

GH-110065 is a backport of this pull request to the 3.11 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.11 only security fixes label Sep 29, 2023
vstinner added a commit that referenced this pull request Sep 29, 2023
…nError (GH-110037) (#110065)
gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037)
On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
(cherry picked from commit bd4518c)
Co-authored-by: Victor Stinner <vstinner@python.org>
Yhg1s pushed a commit that referenced this pull request Oct 2, 2023
…nError (GH-110037) (#110064)
gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037)
On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
(cherry picked from commit bd4518c)
Co-authored-by: Victor Stinner <vstinner@python.org>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…Error (python#110037)
On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@bedevere-bot@miss-islington