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-137969: Fix double evaluation ofForwardRefs which rely on globals#140974

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
dr-carlos wants to merge9 commits intopython:main
base:main
Choose a base branch
Loading
fromdr-carlos:fwdref-double-eval

Conversation

@dr-carlos
Copy link
Contributor

@dr-carlosdr-carlos commentedNov 4, 2025
edited by bedevere-appbot
Loading

@JelleZijlstraJelleZijlstra added the needs backport to 3.14bugs and security fixes labelNov 6, 2025
Copy link
Member

@JelleZijlstraJelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks! Could you also add a unit test asserting that if a locals dictionary is passed in, it's not modified?

dr-carlos reacted with thumbs up emoji
try:
globals[cell_name]=cell_value.cell_contents
ifcell_namenotinlocals:
locals[cell_name]=cell_value.cell_contents
Copy link
Member

Choose a reason for hiding this comment

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

Can you narrow the try-except so it only covers this line? (The part that can raise ValueError is the.cell_contents attribute read.)

dr-carlos reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hopefully replacing withsetdefault is fine - if the object doesn't have a 'setdefault' attribute, it will raise anAttributeError notValueError.

@dr-carlos
Copy link
ContributorAuthor

Thanks! Could you also add a unit test asserting that if a locals dictionary is passed in, it's not modified?

Added one to test globals and locals, since they're both dicts which are mutable.

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

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@dr-carlos@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp