Serhiy Storchaka added the comment:

Ah, I tested only with non-debug build in which asserts were ignored! In 2.7 
Element doesn't support garbage collection, and the trashcan mechanism 
Py_TRASHCAN_SAFE_BEGIN/Py_TRASHCAN_SAFE_END can't be applied.

I see three alternatives:

1. Just revert the changes. Let deep ElementTree crashing.

2. Add the support of garbage collection. This will increase the size of empty 
Element by 1.5 times. This looks less appropriate that the first option since 
this harms working code.

3. Try to implement different mechanism. By using external list object as a 
stack or using other field for creating a linked list.

I'll revert the patch (except tests fix) and will try to implement different 
mechanism.

----------
stage: resolved -> needs patch
versions:  -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