Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commented Jan 5, 2022

This reverts commit ea25180.

Keep "assert(interned == NULL);" in _PyUnicode_Fini() but only for
the main interpreter.

Keep _PyUnicode_ClearInterned() changes avoiding the creation of a
temporary Python list object.

https://bugs.python.org/issue46006

@vstinnervstinner changed the title Revert "bpo-40521: Per-interpreter interned strings (GH-20085)"bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)"Jan 5, 2022
)" This reverts commit ea25180. Keep "assert(interned == NULL);" in _PyUnicode_Fini() but only for the main interpreter. Keep _PyUnicode_ClearInterned() changes avoiding the creation of a temporary Python list object.
@vstinner
Copy link
MemberAuthor

Python 3.10 is also affected by https://bugs.python.org/issue46006. So I propose to revert the commit ea25180 in the 3.10 and main branches with this PR.

This change is not a simple revert, I made manual changes to make the commit as small as possible, but keep interesting changes of the reverted commit, and not regression in bugs at the Python finalization (clear Python objects in the correct order).

Copy link
Member

@ericsnowcurrentlyericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

FWIW, moving it to _PyRuntimeState instead of back to a static would make sense. However, in the interest of the release that can be dealt with separately.

@vstinnervstinner merged commit 35d6540 into python:mainJan 6, 2022
@vstinnervstinner deleted the revert_interned branch January 6, 2022 07:53
vstinner added a commit that referenced this pull request Jan 6, 2022
…GH-20085)" (GH-30422) (GH-30425) This reverts commit ea25180. Keep "assert(interned == NULL);" in _PyUnicode_Fini(), but only for the main interpreter. Keep _PyUnicode_ClearInterned() changes avoiding the creation of a temporary Python list object. Leave the PyInterpreterState structure unchanged to keep the ABI backward compatibility with Python 3.10.0: rename the "interned" member to "unused_interned". (cherry picked from commit 35d6540)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@vstinner@ericsnowcurrently@the-knights-who-say-ni@bedevere-bot