]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing...
authorPetr Viktorin <encukou@gmail.com>
Wed, 17 Jul 2024 12:51:42 +0000 (14:51 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2024 12:51:42 +0000 (14:51 +0200)
commit4395d68c7017eacf0ad643befe1f1e0bc6149f26
treecb3fe15222bb1bf9a4f7bac35985b383d04681ee
parent72cd53ea15c6b304b826fe2ec69fa5afb1d3664e
[3.13] gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing in other API (GH-121364) (GH-121854)

* Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs

* Document immortality in some functions that take `const char *`

This is PyUnicode_InternFromString;
PyDict_SetItemString, PyObject_SetAttrString;
PyObject_DelAttrString; PyUnicode_InternFromString;
and the PyModule_Add convenience functions.

Always point out a non-immortalizing alternative.

* Don't immortalize user-provided attr names in _ctypes
(cherry picked from commit b4aedb23ae7954fb58084dda16cd41786819a8cf)
Doc/c-api/module.rst
Doc/c-api/object.rst
Doc/c-api/unicode.rst
Misc/NEWS.d/next/C API/2024-07-04-15-41-10.gh-issue-113993.cLSiWV.rst [new file with mode: 0644]
Modules/_ctypes/_ctypes.c
Objects/unicodeobject.c