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

gh-129573: Fix possible abort from non-string suggestions incalculate_suggestions/_Py_CalculateSuggestions#130997

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
devdanzin wants to merge9 commits intopython:main
base:main
Choose a base branch
Loading
fromdevdanzin:fix_nonstring_suggestions2

Conversation

devdanzin
Copy link
Contributor

@devdanzindevdanzin commentedMar 9, 2025
edited by bedevere-appbot
Loading

This PR adds a simple check that suggestion candidates are strings incalculate_suggestions(3.12)/_Py_CalculateSuggestions(main), avoiding an abort in debug builds from code like below:

importrunpyrunpy._run_module_code("blech", {0:"","bluch":""},"")

The abort only happens in 3.12, because the code in main checks for non-string candidates in_suggestions__generate_suggestions_impl. However, since the affected codeis still present in main, this PR is against that branch.

In main, the code above exits the new REPL, which will be reported as a new issue with associated PR.

Found usingfusil by@vstinner.

@vstinner
Copy link
Member

test_traceback is failing on the CI.

@tomasr8tomasr8 removed the needs backport to 3.12only security fixes labelApr 10, 2025
@python-cla-bot
Copy link

python-cla-botbot commentedApr 18, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@vstinner
Copy link
Member

@devdanzin: Tests are failing on your PR, and you didn't sign the CLA. What's the status of this PR?

@devdanzin
Copy link
ContributorAuthor

I'm sorry, I've left this one fall behind. Would you like to take it over?

I have signed the CLA and even contributed some trivial code, I'll wait to see if it's a CLA bot issue or my CLA status changed to unverified somehow.

def test_suggestions_do_not_trigger_with_non_string_candidates(self):
def run_module_code():
import runpy
runpy._run_module_code("blech", {0: "", "bluch": ""}, "")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
runpy._run_module_code("blech", {0:"","bluch":""},"")
# non-string global variable
runpy._run_module_code("blech", {0:"","bluch":""},"")

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner left review comments

Assignees
No one assigned
Labels
awaiting reviewneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixes
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@devdanzin@vstinner@serhiy-storchaka@tomasr8@picnixz

[8]ページ先頭

©2009-2025 Movatter.jp