New submission from Serhiy Storchaka: ElementTree iteration code holds borrowed references when call user code (comparison with the tag, concatenating text and tail lazy lists, testing text and tail for empty). User code can make borrowed references invalid and this can lead to a crash. One example is provided by Martin in msg256495. Other possible cases can be more hard to reproduce.
Proposed patch makes iterating code to own references that it operates. ---------- components: Extension Modules, XML files: etree_iter_refcount.patch keywords: patch messages: 256673 nosy: martin.panter, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Fixed various refcount issues in ElementTree iteration type: crash versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file41352/etree_iter_refcount.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25902> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com