Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" #30422

Merged
merged 1 commit into from
Jan 6, 2022
Merged

bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" #30422

merged 1 commit into from
Jan 6, 2022

Conversation

vstinner
Copy link
Member

@vstinner vstinner 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

@vstinner vstinner 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
Member Author

vstinner commented Jan 5, 2022

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

@ericsnowcurrently ericsnowcurrently 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.

@vstinner vstinner merged commit 35d6540 into python:main Jan 6, 2022
@vstinner vstinner 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 free to 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