[Python-checkins] [3.11] gh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (GH-104473) (#104500)

iritkatriel webhook-mailer at python.org
Mon May 15 05:15:15 EDT 2023


https://github.com/python/cpython/commit/a712c5f42d5904e1a1cdaf11bd1f05852cfdd830
commit: a712c5f42d5904e1a1cdaf11bd1f05852cfdd830
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2023-05-15T10:15:07+01:00
summary:

[3.11] gh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (GH-104473) (#104500)

files:
A Misc/NEWS.d/next/Documentation/2023-05-14-12-11-28.gh-issue-67056.nVC2Rf.rst
M Doc/library/atexit.rst

diff --git a/Doc/library/atexit.rst b/Doc/library/atexit.rst
index f7f038107d11..a2bd85b31c9a 100644
--- a/Doc/library/atexit.rst
+++ b/Doc/library/atexit.rst
@@ -20,6 +20,9 @@ at interpreter termination time they will be run in the order ``C``, ``B``,
 program is killed by a signal not handled by Python, when a Python fatal
 internal error is detected, or when :func:`os._exit` is called.
 
+**Note:** The effect of registering or unregistering functions from within
+a cleanup function is undefined.
+
 .. versionchanged:: 3.7
     When used with C-API subinterpreters, registered functions
     are local to the interpreter they were registered in.
diff --git a/Misc/NEWS.d/next/Documentation/2023-05-14-12-11-28.gh-issue-67056.nVC2Rf.rst b/Misc/NEWS.d/next/Documentation/2023-05-14-12-11-28.gh-issue-67056.nVC2Rf.rst
new file mode 100644
index 000000000000..2c6ef1781072
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2023-05-14-12-11-28.gh-issue-67056.nVC2Rf.rst
@@ -0,0 +1,2 @@
+Document that the effect of registering or unregistering an :mod:`atexit`
+cleanup function from within a registered cleanup function is undefined.



More information about the Python-checkins mailing list