Skip to content

[mypyc] Fix reference leak on failure in specialized dict methods - #22233

Merged
p-sawicki merged 1 commit into
python:masterfrom
p-sawicki:dict_ops-release-partial-lists
Oct 20, 2026
Merged

p-sawicki merged 1 commit into
python:masterfrom
p-sawicki:dict_ops-release-partial-lists

Conversation

@p-sawicki

@p-sawicki p-sawicki commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

The specializations for list(subdict.m()) where m is keys, values, or items create an empty list to extend with the result of the method. If the method raises, the list is not cleaned up.

Use PySequence_List instead which does the same thing with correct memory handling.

@p-sawicki
p-sawicki merged commit 31f63e0 into python:master Oct 20, 2026
18 checks passed
@p-sawicki
p-sawicki deleted the dict_ops-release-partial-lists branch October 20, 2026 15:54
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.

2 participants