parsed XML raises lxml.etree.SerialisationError: IO_ENCODER on lxml.etree.tostring() call
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
scoder |
Bug Description
When trying to dump do string parsed XML it raises such exception [1].
Testcase attached.
[1]
$ python test.py
lxml.etree: (2, 2, 0, 0)
libxml used: (2, 7, 3)
libxml compiled: (2, 7, 3)
libxslt used: (1, 1, 24)
libxslt compiled: (1, 1, 24)
Got: lxml_elem: <Element nokaut at 81827fc>
Counted 13797 tags: 'offer', string.count()ed: 27602
Traceback (most recent call last):
File "test.py", line 28, in <module>
lxml_txt = lxml.etree.
File "lxml.etree.pyx", line 2625, in lxml.etree.tostring (src/lxml/
File "serializer.pxi", line 124, in lxml.etree.
File "serializer.pxi", line 149, in lxml.etree.
lxml.etree.
It is quite possible that the recovery mode leaves broken content in the tree here. However, recovering from broken data is not guaranteed to succeed, so I won't give a high priority to this problem.