New submission from Serhiy Storchaka:

The Element class in the xml.etree.ElementTree module is a collection. It can 
contain other Element's. But unlike to common Python collections (list, dict, 
etc) and pure Python classes, C implementation of Element doesn't support 
unlimited recursion. As result, destroying very deep Element tree can cause 
stack overflow. Example:

import xml.etree.cElementTree as ElementTree
y = x = ElementTree.Element('x')
for i in range(200000): y = ElementTree.SubElement(y, 'x')

del x

----------
components: Extension Modules
messages: 282376
nosy: eli.bendersky, scoder, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Destructor of ElementTree.Element is recursive
type: crash
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28871>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to