Fix build error for qt5+py3

This commit is contained in:
tzutalin
2017-07-07 23:14:41 +08:00
parent 9899c131d1
commit 2d92e10529
2 changed files with 21 additions and 8 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ class PascalVocWriter:
"""
rough_string = ElementTree.tostring(elem, 'utf8')
root = etree.fromstring(rough_string)
return etree.tostring(root, pretty_print=True, encoding=ENCODE_METHOD).replace(' ', '\t')
return etree.tostring(root, pretty_print=True, encoding=ENCODE_METHOD).replace(" ".encode(), "\t".encode())
# minidom does not support UTF-8
'''reparsed = minidom.parseString(rough_string)
return reparsed.toprettyxml(indent="\t", encoding=ENCODE_METHOD)'''