Skip to content

gh-146056: Fix TreeBuilder stack in xml.etree#146062

Open
vstinner wants to merge 1 commit intopython:mainfrom
vstinner:fix_etree_stack
Open

gh-146056: Fix TreeBuilder stack in xml.etree#146062
vstinner wants to merge 1 commit intopython:mainfrom
vstinner:fix_etree_stack

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Mar 17, 2026

No longer create a stack of 20 items, but create an empty stack instead. It prevents crashes when the stack list is discovered by gc.get_referrers() or other functions.

Fix also reference counting in treebuilder_handle_end().

No longer create a stack of 20 items, but create an empty stack
instead. It prevents crashes when the stack list is discovered by
gc.get_referrers() or other functions.

Fix also reference counting in treebuilder_handle_end().
@vstinner
Copy link
Member Author

I added "skip news" since this issue requires calling gc.get_referrers() which is used in "regular code".

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.

1 participant