GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-122728: Fix SystemError in PyEval_GetLocals() by vstinner · Pull Request #122735 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Aug 6, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fix PyEval_GetLocals() to avoid SystemError ("bad argument to internal function"). Don't redefine the 'ret' variable in the if block.

Add an unit test on PyEval_GetLocals().

  • Issue: 3.13.0rc1 regression in PyEval_GetLocals(): SystemError: Objects/dictobject.c:3774: bad argument to internal function #122728

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner requested a review from markshannon as a code owner August 6, 2024 12:24
@bedevere-app bedevere-app Bot mentioned this pull request Aug 6, 2024
3.13.0rc1 regression in PyEval_GetLocals(): SystemError: Objects/dictobject.c:3774: bad argument to internal function #122728
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 6, 2024
@vstinner
pythongh-122728: Fix SystemError in PyEval_GetLocals()
c304680
Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
@vstinner
vstinner force-pushed the get_locals branch from 1b9defc to c304680 Compare August 6, 2024 12:26
@vstinner

vstinner commented Aug 6, 2024

Copy link
Copy Markdown
Member Author

cc @gaogaotiantian @ncoghlan

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hroncok

hroncok commented Aug 6, 2024

Copy link
Copy Markdown
Contributor

Will test this in Fedora.

vstinner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
Complete the unit test
a3c0358
@vstinner

vstinner commented Aug 6, 2024

Copy link
Copy Markdown
Member Author

Without the Python/ceval.c fix, the unit test reproduces the SystemError bug.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hroncok
hroncok approved these changes Aug 6, 2024
View reviewed changes

@hroncok hroncok left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The change makes sense, is justified in the commit message, and fixes the problem in Fedora.

I have not verified the test fails without the fix, but I trust @vstinner that he has.

The test makes reasonable assertions and calls PyEval_GetLocals.

The news fragment is as detailed as needed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
serhiy-storchaka
serhiy-storchaka approved these changes Aug 6, 2024
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Aug 6, 2024
gaogaotiantian
gaogaotiantian approved these changes Aug 6, 2024
View reviewed changes
@Eclips4 Eclips4 added the needs backport to 3.13 only security fixes label Aug 6, 2024
@vstinner
vstinner merged commit 4767a6e into python:main Aug 6, 2024
@vstinner
vstinner deleted the get_locals branch August 6, 2024 21:01
@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 6, 2024
@miss-islington-app

miss-islington-app Bot commented Aug 6, 2024

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 6, 2024
@vstinner @miss-islington
pythongh-122728: Fix SystemError in PyEval_GetLocals() (pythonGH-122735)
4b5380b
Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
(cherry picked from commit 4767a6e)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app

bedevere-app Bot commented Aug 6, 2024

Copy link
Copy Markdown

GH-122757 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Aug 6, 2024
@thesamesam

thesamesam commented Aug 6, 2024

Copy link
Copy Markdown
Contributor

Many thanks for the quick fix and @hroncok for testing it too. Lovely to wake up to :)

vstinner reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added a commit that referenced this pull request Aug 6, 2024
@miss-islington @vstinner
[3.13] gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735) (#…
5c161cb
…122757)

gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735)

Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
(cherry picked from commit 4767a6e)

Co-authored-by: Victor Stinner <[email protected]>
@Eclips4 Eclips4 mentioned this pull request Aug 7, 2024
[3.13.0rc1][greenlet] _PyFrame_GetCode: Assertion `PyCode_Check(f->f_executable)' failed (regression from 3.13.0b4) #122772
Closed
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
@vstinner @brandtbucher
pythongh-122728: Fix SystemError in PyEval_GetLocals() (python#122735)
94cf6e7
Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
@vstinner @blhsing
pythongh-122728: Fix SystemError in PyEval_GetLocals() (python#122735)
a68e530
Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@gaogaotiantian gaogaotiantian gaogaotiantian approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
+1 more reviewer
@hroncok hroncok hroncok approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@vstinner @hroncok @thesamesam @serhiy-storchaka @gaogaotiantian @Eclips4
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.