◐ Shell
reader mode source ↗
Skip to content

gh-108963: using random to generate unique string in sys.intern test#109491

Merged
vstinner merged 6 commits into
python:mainfrom
aisk:fix-gh108963
Oct 2, 2023
Merged

gh-108963: using random to generate unique string in sys.intern test#109491
vstinner merged 6 commits into
python:mainfrom
aisk:fix-gh108963

Conversation

@aisk

@aisk aisk commented Sep 16, 2023

Copy link
Copy Markdown
Member

@bedevere-app bedevere-app Bot added awaiting review tests Tests in the Lib/test dir labels Sep 16, 2023
@aisk aisk changed the title using random to generate unique string in sys.intern test Sep 16, 2023
@vstinner

Copy link
Copy Markdown
Member

This change hides the issue that the test actually leaks memory: intern a string which is then only released at Python exit. Can we add a private deintern() function in _testcapi? Or run the test in a subprocess?

Well, i don't know that it's a big deal, this change is ooookay-ish.

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

LGTM.

It makes me sad to leak memory. But I'm not sure about a private API to de-intern a string. I'm not sure of the consequences.

@vstinner vstinner merged commit 44b1e4e into python:main Oct 2, 2023
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @aisk for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @aisk and @vstinner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 44b1e4ea4842c6cdc1bedba7aaeb93f236b3ec08 3.12

@bedevere-app

bedevere-app Bot commented Oct 2, 2023

Copy link
Copy Markdown

GH-110216 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 2, 2023
Yhg1s pushed a commit that referenced this pull request Oct 2, 2023
…n test … (#110216)

gh-108963: using random to generate unique string in sys.intern test (#109491)

(cherry picked from commit 44b1e4e)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
@aisk aisk deleted the fix-gh108963 branch October 3, 2023 07:16
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants