diff --git a/testing/mozbase/mozlog/mozlog/formatters/xunit.py b/testing/mozbase/mozlog/mozlog/formatters/xunit.py index 02966d713aaec..ac08be265eb32 100644 --- a/testing/mozbase/mozlog/mozlog/formatters/xunit.py +++ b/testing/mozbase/mozlog/mozlog/formatters/xunit.py @@ -4,6 +4,7 @@ from xml.etree import ElementTree +import re import six from . import base @@ -109,6 +110,8 @@ def suite_end(self, data): } ) xml_string = ElementTree.tostring(self.root, encoding="utf8") + # Need to remove control characters as they confuse minidom + xml_string = re.sub(r'[\x00-\x1F]+', '', xml_string.decode()) # pretty printing can not be done from xml.etree from xml.dom import minidom