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

test_multiprocessing_spawn: Popen.terminate() failed with PermissionError: [WinError 5] Access is denied #110036

Closed
vstinner opened this issue Sep 28, 2023 · 0 comments

Comments

@vstinner
Copy link
Member

vstinner commented Sep 28, 2023

subprocess.terminate() catchs PermissionError: we can reuse their code. I'm working on a fix.

GHA Windows x86:

ERROR: tearDownClass (test.test_multiprocessing_spawn.test_manager.WithManagerTestPool)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\_test_multiprocessing.py", line 2483, in tearDownClass
    super().tearDownClass()
  File "D:\a\cpython\cpython\Lib\test\_test_multiprocessing.py", line 6131, in tearDownClass
    cls.manager.shutdown()
  File "D:\a\cpython\cpython\Lib\multiprocessing\util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\managers.py", line 683, in _finalize_manager
    process.terminate()
  File "D:\a\cpython\cpython\Lib\multiprocessing\process.py", line 133, in terminate
    self._popen.terminate()
  File "D:\a\cpython\cpython\Lib\multiprocessing\popen_spawn_win32.py", line 124, in terminate
    _winapi.TerminateProcess(int(self._handle), TERMINATE)
PermissionError: [WinError 5] Access is denied

build: https://github.com/python/cpython/actions/runs/6340922718/job/17223431499?pr=110026

Linked PRs

vstinner added a commit to vstinner/cpython that referenced this issue Sep 28, 2023
…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 added a commit to vstinner/cpython that referenced this issue Sep 28, 2023
…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 added a commit that referenced this issue Sep 29, 2023
…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.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue 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 issue 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]>
vstinner added a commit that referenced this issue 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]>
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 issue 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

No branches or pull requests

1 participant