This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kuraga
Recipients kuraga
Date 2019-09-05.20:50:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567716601.15.0.507352834054.issue38042@roundup.psfhosted.org>
In-reply-to
Content
I have a crash in Python 3.x environments and don't have in 2.7.

===

Crashes in:

Python 3.7.4, Anaconda, Linux 64bit, lxml 4.3.3
OR
Python 3.7.4, Anaconda, Linux 64bit, lxml 4.4.1
OR
Python 3.6.5, Gentoo Linux 64bit, lxml 4.3.3

test.py:

import lxml
import lxml.etree

with open('test.xml', 'rb') as f:
    list(
        lxml.etree.iterparse(f)
    )

    # Traceback (most recent call last):
    # File "test.py", line 18, in <module>
    # lxml.etree.iterparse(f)
    # File "src/lxml/iterparse.pxi", line 209, in lxml.etree.iterparse.__next__
    # File "src/lxml/iterparse.pxi", line 194, in lxml.etree.iterparse.__next__
    # File "src/lxml/iterparse.pxi", line 225, in lxml.etree.iterparse._read_more_events
    # File "src/lxml/parser.pxi", line 1380, in lxml.etree._FeedParser.close
    # Segmentation fault
    list(
        lxml.etree.iterparse(f)
    )

test.xml:

<?xml version="1.0" encoding="UTF-8"?>
<root></root>

(or any else)

GDB's backtrace see in attachment.

===

Doesn't crash in:

Python 2.7.15, Gentoo Linux 64bit, lxml 4.3.3

# Traceback (most recent call last):
#   File "test.py", line 19, in <module>
#     lxml.etree.iterparse(f)
#   File "src/lxml/iterparse.pxi", line 209, in lxml.etree.iterparse.__next__
#    File "/home/sasha/_lxml-bug/test.xml", line 0
lxml.etree.XMLSyntaxError: no element found

===

See also: https://bugs.launchpad.net/lxml/+bug/1833050
History
Date User Action Args
2019-09-05 20:50:01kuragasetrecipients: + kuraga
2019-09-05 20:50:01kuragasetmessageid: <1567716601.15.0.507352834054.issue38042@roundup.psfhosted.org>
2019-09-05 20:50:01kuragalinkissue38042 messages
2019-09-05 20:50:00kuragacreate