You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If "prettyprint=False", to_xml_string() converts the xml string to byte instead of string.
File "C:\Python33\Lib\site-packages\junit_xml-1.0-py3.3.egg\junit_xml__init__.py", line 149, in to_file
file_descriptor.write(TestSuite.to_xml_string(test_suites, prettyprint))
TypeError: must be str, not bytes
This is because of the following line in to_xml_string():
xml_string = ET.tostring(xml_element)
which causes ET.tostring() to convert to BytesIO instead of StringIO. The fix is:
xml_string = ET.tostring(xml_element, encoding="unicode")
The text was updated successfully, but these errors were encountered:
This must be a Python 2 vs Python 3 issue. I don't know enough about the differences to fix this in a cross-version way. If you have one that works on Python 2 and 3, please send a pull request.
If "prettyprint=False", to_xml_string() converts the xml string to byte instead of string.
File "C:\Python33\Lib\site-packages\junit_xml-1.0-py3.3.egg\junit_xml__init__.py", line 149, in to_file
file_descriptor.write(TestSuite.to_xml_string(test_suites, prettyprint))
TypeError: must be str, not bytes
This is because of the following line in to_xml_string():
xml_string = ET.tostring(xml_element)
which causes ET.tostring() to convert to BytesIO instead of StringIO. The fix is:
xml_string = ET.tostring(xml_element, encoding="unicode")
The text was updated successfully, but these errors were encountered: