Skip to content
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

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

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 28, 2023

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.
@vstinner vstinner added awaiting review 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels Sep 28, 2023
@bedevere-bot
Copy link

🤖 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-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 28, 2023
@AlexWaygood AlexWaygood changed the title gh-110036: multiprocessing Popen.terminate() catchs PermissionError gh-110036: multiprocessing Popen.terminate() catches PermissionError Sep 28, 2023
@vstinner
Copy link
Member Author

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:main Sep 29, 2023
@vstinner vstinner deleted the mp_popen_terminate branch September 29, 2023 00:41
@miss-islington
Copy link
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 <[email protected]>
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 <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 29, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Sep 29, 2023
@bedevere-app
Copy link

bedevere-app bot commented Sep 29, 2023

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

@bedevere-app bedevere-app bot 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 <[email protected]>
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 <[email protected]>
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 free to 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