You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memory leak when re-initializing an Element in the _elementtree C accelerator #153537
The _elementtree C accelerator's Element.__init__ (element_init) calls create_extra, which allocates a new extra without freeing the previous one. Re-initializing an element that already has children or attributes therefore leaks them; the pure-Python Element.__init__ resets the children, so the two implementations diverge.
Repro (prints three live Elements on the C accelerator, [None, None, None] on pure Python):
Activity
serhiy-storchaka commentedon Aug 17, 2026
This is a duplicate of #114795.
_elementtree.XMLParsercan leak references if__init__method called on instance #114795