Joe McDonnell created IMPALA-12045:
--------------------------------------
Summary: generate_junitxml.py fails when the content contains ANSI
escape sequences
Key: IMPALA-12045
URL: https://issues.apache.org/jira/browse/IMPALA-12045
Project: IMPALA
Issue Type: Bug
Components: Infrastructure
Affects Versions: Impala 4.3.0
Reporter: Joe McDonnell
The Impala build tries to generate JUnitXML for compilation failures. This is
currently failing with this error:
{noformat}
14:25:30 Traceback (most recent call last):
14:25:30 File "Impala/bin/generate_junitxml.py", line 273, in <module>
14:25:30 main()
14:25:30 File "Impala/bin/generate_junitxml.py", line 268, in main
14:25:30 junit_log_file = junit_report.to_file()
14:25:30 File "Impala/bin/generate_junitxml.py", line 169, in to_file
14:25:30 f.write(unicode(self))
14:25:30 File "Impala/bin/generate_junitxml.py", line 206, in __unicode__
14:25:30 root_node_dom = minidom.parseString(root_node_unicode)
14:25:30 File "/usr/lib64/python2.7/xml/dom/minidom.py", line 1931, in
parseString
14:25:30 return expatbuilder.parseString(string)
14:25:30 File "/usr/lib64/python2.7/xml/dom/expatbuilder.py", line 940, in
parseString
14:25:30 return builder.parseString(string)
14:25:30 File "/usr/lib64/python2.7/xml/dom/expatbuilder.py", line 223, in
parseString
14:25:30 parser.Parse(string, True)
14:25:30 xml.parsers.expat.ExpatError: not well-formed (invalid token): line 2,
column 0{noformat}
It appears to be related to ANSI escape sequences that add color to the
compilation warning output. If we strip out the ANSI escape sequences, then the
JUnitXML generation works.
Here is a thread about solutions that strip ANSI escape characters:
https://stackoverflow.com/questions/14693701/how-can-i-remove-the-ansi-escape-sequences-from-a-string-in-python
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]