Skip to content

Fix traceback crash when exec locals is not a mapping 🤖🤖 - #15410

Open
Dmao233 wants to merge 1 commit into
ipython:mainfrom
Dmao233:fix-12551-exec-locals-traceback
Open

Dmao233 wants to merge 1 commit into
ipython:mainfrom
Dmao233:fix-12551-exec-locals-traceback

Conversation

@Dmao233

@Dmao233 Dmao233 commented Oct 1, 2026

Copy link
Copy Markdown

Closes #12551

exec('a = 5', {}, []) raises TypeError and can leave a frame whose f_locals is a list. VerboseTB then called .get while checking __tracebackhide__ and raised AttributeError.

Treat locals without a callable .get as having no hide flag so the original exception can be shown. Mapping locals (dict, FrameLocalsProxy) are unchanged.

🤖🤖

exec('a = 5', {}, []) raises TypeError and can leave a frame whose
f_locals is a list. VerboseTB called .get while checking
__tracebackhide__ and raised AttributeError (ipythongh-12551). Treat
non-mapping locals as having no hide flag.

🤖🤖

Co-authored-by: CenFangyu <[email protected]>

This branch has not been deployed

No deployments
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.

Invalid exec call crashed IPython shell

1 participant