]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-114570: Add PythonFinalizationError exception (#115352)
authorVictor Stinner <vstinner@python.org>
Wed, 14 Feb 2024 22:35:06 +0000 (23:35 +0100)
committerGitHub <noreply@github.com>
Wed, 14 Feb 2024 22:35:06 +0000 (23:35 +0100)
commit3e7b7df5cbaad5617cc28f0c005010787c48e6d6
tree3ce4371899be9adafac100da28b30b30884e7af9
parent326119d3731f784aa9f5d4afa7b687dd1ab1d916
gh-114570: Add PythonFinalizationError exception (#115352)

Add PythonFinalizationError exception. This exception derived from
RuntimeError is raised when an operation is blocked during the Python
finalization.

The following functions now raise PythonFinalizationError, instead of
RuntimeError:

* _thread.start_new_thread()
* subprocess.Popen
* os.fork()
* os.fork1()
* os.forkpty()

Morever, _winapi.Overlapped finalizer now logs an unraisable
PythonFinalizationError, instead of an unraisable RuntimeError.
13 files changed:
Doc/library/exceptions.rst
Doc/library/sys.rst
Doc/whatsnew/3.13.rst
Include/cpython/pyerrors.h
Lib/test/exception_hierarchy.txt
Lib/test/test_pickle.py
Misc/NEWS.d/next/Core and Builtins/2024-02-12-17-18-26.gh-issue-114570.BzwMlJ.rst [new file with mode: 0644]
Modules/_posixsubprocess.c
Modules/_threadmodule.c
Modules/_winapi.c
Modules/posixmodule.c
Objects/exceptions.c
Tools/c-analyzer/cpython/globals-to-fix.tsv