Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6aee7f5

Browse files
Addressed Comments
1 parent8484c4b commit6aee7f5

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

‎Doc/whatsnew/3.14.rst‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,7 @@ New Features
417417
which has an ambiguous return value.
418418
(Contributed by Irit Katriel and Erlend Aasland in:gh:`105201`.)
419419

420-
* Modified the ``_PyUnicode_ClearInterned`` function to always delete all
421-
interned strings during a call to:c:func:`Py_Finalize`. This
420+
*:c:func:`Py_Finalize` now deletes all interned strings. This
422421
is backwards incompatible to any C-Extension that holds onto an interned
423422
string after a call to:c:func:`Py_Finalize` and is then reused after a
424423
call to:c:func:`Py_Initialize`. Any issues arising from this behavior will
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1 @@
1-
This updates the interned string deallocation function
2-
``_PyUnicode_ClearInterned`` to delete all interned strings during runtime
3-
finalization when calling ``Py_Finalize``, regardless of their reference
4-
count.
5-
6-
Worth noting that if an extension accidentally holds onto a interned string,
7-
even after calling Py_Finalize, it will result in use-after-free error,
8-
leaving the user to a potential vulnerabilities. That said, the history of
9-
how these interned strings are handled have been changing during throughout
10-
different versions.
11-
12-
For example, in Python 3.9 and older, interned strings were never deleted.
13-
Only special builds for Valgrind and Purity cleared them at exit. In Python
14-
3.10 and 3.11, interned strings are always deleted at exit. In Python 3.12,
15-
interned strings are deleted only if Python is built in debug mode: they
16-
are not deleted in release mode. In Python 3.13, interned strings will
17-
now be all deleted.
18-
19-
Given how the guarantees changed throughout different versions, it is not
20-
expected that users actively rely on this behavior for their extensions.
1+
:c:func:`Py_Finalize` now deletes all interned strings.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp