Skip to content

gh-156459: Fix cleanup on error in compiler_set_qualname - #156462

Open
iritkatriel wants to merge 3 commits into
python:mainfrom
iritkatriel:gh-156459
Open

gh-156459: Fix cleanup on error in compiler_set_qualname#156462
iritkatriel wants to merge 3 commits into
python:mainfrom
iritkatriel:gh-156459

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Aug 27, 2026

Copy link
Copy Markdown
Member

Move the operation to _PyCompile_SetQualname and call it after _PyCompile_EnterScope returns (with cleanup if it fails).

Resolves #156459.

This was discovered through code inspection, not via a runtime bug. There is no reliable way to write a test for this as failures would be memory errors and the like.

@iritkatriel iritkatriel added 3.13 bugs and security fixes 3.14 bugs and security fixes 3.15 pre-release feature fixes, bugs and security fixes 3.16 new features, bugs and security fixes labels Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.13 bugs and security fixes 3.14 bugs and security fixes 3.15 pre-release feature fixes, bugs and security fixes 3.16 new features, bugs and security fixes awaiting core review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect error handling when compiler_set_qualname fails

1 participant