py3: etree.tostring emits bytes, and must be written using binary mode

This commit is contained in:
Eli Schwartz 2019-09-09 21:59:46 -04:00
parent d78e4807c3
commit 8078bf0931
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -235,6 +235,6 @@ class CSV_XML(CatalogPlugin):
if 'library_name' in fields:
record.append(E.library_name(current_library))
with open(path_to_output, 'w') as f:
with open(path_to_output, 'wb') as f:
f.write(etree.tostring(root, encoding='utf-8',
xml_declaration=True, pretty_print=True))