diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-11-12 00:06:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-12 00:06:05 (GMT) |
commit | 7f3a4b967cfb1596a3fda6c34f900f8586b16700 (patch) | |
tree | c4381e2cdfce4f636d2eff0288bf5ec59c74c44d /Misc | |
parent | 67807cfc87135fdce4992d38d2ffe3e44747e73b (diff) | |
download | cpython-7f3a4b967cfb1596a3fda6c34f900f8586b16700.zip cpython-7f3a4b967cfb1596a3fda6c34f900f8586b16700.tar.gz cpython-7f3a4b967cfb1596a3fda6c34f900f8586b16700.tar.bz2 |
gh-81057: Move PyImport_Inittab to _PyRuntimeState (gh-99402)
We actually don't move PyImport_Inittab. Instead, we make a copy that we keep on _PyRuntimeState and use only that after Py_Initialize(). We also prevent folks from modifying PyImport_Inittab (the best we can) after that point.
https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2022-11-11-14-48-17.gh-issue-81057.ik4iOv.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-11-11-14-48-17.gh-issue-81057.ik4iOv.rst b/Misc/NEWS.d/next/Core and Builtins/2022-11-11-14-48-17.gh-issue-81057.ik4iOv.rst new file mode 100644 index 0000000..7474cee --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-11-11-14-48-17.gh-issue-81057.ik4iOv.rst @@ -0,0 +1,6 @@ +The docs clearly say that ``PyImport_Inittab``, +:c:func:`PyImport_AppendInittab`, and :c:func:`PyImport_ExtendInittab` +should not be used after :c:func:`Py_Initialize` has been called. +We now enforce this for the two functions. Additionally, the runtime +now uses an internal copy of ``PyImport_Inittab``, +to guard against modification. |