Kind of weird that it doesn’t work. Try changing line 400 to
output_xml_str = ET.tostring(root, method ='xml',
pretty_print =True ,
xml_declaration=False ,
encoding ='UTF-8')
OUTOBJ.write(output_xml_str.decode("utf-8") )
If that doesn’t work, I assume there’s some problem with the XML root
. You should print output_xml_str
and inspect what it is (it should be a string).
Cheers,
Alex