]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-87135: threading.Lock: Raise rather than hang on Python finalization (GH-135991)
authorPetr Viktorin <encukou@gmail.com>
Tue, 1 Jul 2025 08:57:42 +0000 (10:57 +0200)
committerGitHub <noreply@github.com>
Tue, 1 Jul 2025 08:57:42 +0000 (10:57 +0200)
commitfe119a08177feea27611450b0bb3901e330a2d58
treec33a312acd4ea9c26415317eb5884f3e1d25a2c6
parent845263adc60430781b8fae9e75575c63fea50dc3
gh-87135: threading.Lock: Raise rather than hang on Python finalization (GH-135991)

After Python finalization gets to the point where no other thread
can attach thread state, attempting to acquire a Python lock must hang.
Raise PythonFinalizationError instead of hanging.
Doc/library/exceptions.rst
Include/internal/pycore_lock.h
Lib/test/test_threading.py
Misc/NEWS.d/next/Library/2025-06-27-09-26-04.gh-issue-87135.33z0UW.rst [new file with mode: 0644]
Modules/_threadmodule.c
Python/lock.c