etree.iterparse() raises lxml.etree.XMLSyntaxError: None
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
scoder | ||
Fedora |
Fix Released
|
Undecided
|
|||
Ubuntu |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Using of etree.iterparse() on valid xml throw a weird exception without description.
Python : sys.version_
lxml.etree : (3, 2, 1, 0)
libxml used : (2, 7, 8)
libxml compiled : (2, 7, 8)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 26)
Combination:
libxml2.x86_64 0:2.7.8-7.fc17
libxml2-
python-lxml.x86_64 0:2.3.5-1.fc17
== WORKS FINE ==
Combination:
libxml2.x86_64 0:2.7.8-7.fc17
libxml2-
python-lxml.x86_64 0:3.2.1-1.fc17
== WORKS FINE ==
But when I use the current libxml2 and libxml2-python:
libxml2.x86_64 0:2.7.8-9.fc17
libxml2-
python-lxml.x86_64 0:3.2.1-1.fc17
== ERROR ==
How reproducible:
XML:
====
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<foo>
<bar>a</bar>
</foo>
<foo>
<bar>b</bar>
</foo>
</metadata>
Reproducer:
===========
#!/usr/bin/python
from lxml import etree
for element in etree.iterparse
print element[0], element[1].tag
Actual results:
end bar
end foo
end bar
end foo
end metadata
Traceback (most recent call last):
File "./reproducer.py", line 3, in <module>
for element in etree.iterparse
File "iterparse.pxi", line 484, in lxml.etree.
File "iterparse.pxi", line 537, in lxml.etree.
File "parser.pxi", line 627, in lxml.etree.
lxml.etree.
Expected results:
end bar
end foo
end bar
end foo
end metadata
Note:
My original bug report at RedHat bugzilla: https:/
Changed in fedora: | |
importance: | Unknown → Undecided |
status: | Unknown → Fix Released |
Description of problem:
Using of etree.iterparse() on valid xml throw a weird exception without description.
Version-Release number of selected component (if applicable):
Version: 2.3.5
Release: 1.fc17
How reproducible:
XML:
====
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<foo>
<bar>a</bar>
</foo>
<foo>
<bar>b</bar>
</foo>
</metadata>
Reproducer: (open(" xml.xml" )):
===========
#!/usr/bin/python
from lxml import etree
for element in etree.iterparse
print element[0], element[1].tag
Actual results: (open(" xml.xml" )): iterparse. __next_ _ (src/lxml/ lxml.etree. c:103790) iterparse. _read_more_ events (src/lxml/ lxml.etree. c:104333) _raiseParseErro r (src/lxml/ lxml.etree. c:79743) XMLSyntaxError: None
end bar
end foo
end bar
end foo
end metadata
Traceback (most recent call last):
File "./reproducer.py", line 3, in <module>
for element in etree.iterparse
File "iterparse.pxi", line 491, in lxml.etree.
File "iterparse.pxi", line 543, in lxml.etree.
File "parser.pxi", line 601, in lxml.etree.
lxml.etree.
Expected results:
end bar
end foo
end bar
end foo
end metadata