Use "unicode" string for lxml.etree.tostring() serialization

This commit is contained in:
Paul Tremberth 2016-01-15 19:51:21 +01:00
parent 1347015a80
commit 4e44766653
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def xmliter_lxml(obj, nodename, namespace=None, prefix='x'):
iterable = etree.iterparse(reader, tag=tag, encoding=reader.encoding)
selxpath = '//' + ('%s:%s' % (prefix, nodename) if namespace else nodename)
for _, node in iterable:
nodetext = etree.tostring(node, encoding=six.text_type)
nodetext = etree.tostring(node, encoding='unicode')
node.clear()
xs = Selector(text=nodetext, type='xml')
if namespace: