Skip to content

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

Open
p-sawicki wants to merge 1 commit into
python:masterfrom
p-sawicki:dict_ops-release-partial-lists
Open

p-sawicki wants to merge 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.

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.

1 participant