Skip to content

[3.14] gh-159739: Keep generic alias arguments alive while formatting errors (GH-159981) - #160021

Open
miss-islington wants to merge 1 commit into
python:3.14from
miss-islington:backport-9c649db-3.14
Open

miss-islington wants to merge 1 commit into
python:3.14from
miss-islington:backport-9c649db-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

When a generic alias contains a list of parameters and an object claiming to be an unpacked type-variable tuple returns a non-tuple from __typing_subst__, the error path frees the temporary argument tuple before reading it to format a TypeError. That use-after-free can crash the interpreter instead of reporting the invalid substitution.
(cherry picked from commit 9c649db)

Co-authored-by: Jelle Zijlstra jelle@openai.com

…errors (pythonGH-159981)

When a generic alias contains a list of parameters and an object claiming to be an unpacked type-variable tuple returns a non-tuple from `__typing_subst__`, the error path frees the temporary argument tuple before reading it to format a `TypeError`. That use-after-free can crash the interpreter instead of reporting the invalid substitution.
(cherry picked from commit 9c649db)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants