Pass a bytestring to xml.sax.parseString
This fixes the ctest prb. CI was broken because TestRunner errored at: Traceback (most recent call last): File "/foundationdb/tests/TestRunner/TestRunner.py", line 373, in <module> res = run_simulation_test(basedir, args) File "/foundationdb/tests/TestRunner/TestRunner.py", line 313, in run_simulation_test options.log_format, return_codes) File "/foundationdb/tests/TestRunner/TestRunner.py", line 261, in process_traces parser.processTraces() File "/foundationdb/tests/TestRunner/TestRunner.py", line 112, in processTraces obj = self.processLine(line, linenr) File "/foundationdb/tests/TestRunner/TestRunner.py", line 222, in processLine xml.sax.parseString(line, handler, errorHandler=errorHandler) File "/usr/lib/python3.4/xml/sax/__init__.py", line 45, in parseString inpsrc.setByteStream(BytesIO(string)) TypeError: 'str' does not support the buffer interface Which means you can't parse a string to parseString. This was fixed by 3.7, but our CI runs 3.4, so we need to .encode() `line` before passing it, so that it ends up as a `bytes`.
This commit is contained in:
parent
1d12618f7d
commit
2d7f5f505c
|
@ -219,7 +219,7 @@ class XMLParser(LogParser):
|
|||
return None
|
||||
handler = XMLParser.XMLHandler()
|
||||
errorHandler = XMLParser.XMLErrorHandler()
|
||||
xml.sax.parseString(line, handler, errorHandler=errorHandler)
|
||||
xml.sax.parseString(line.encode('utf-8'), handler, errorHandler=errorHandler)
|
||||
if len(errorHandler.fatalErrors) > 0:
|
||||
return self.log_trace_parse_error(linenr, errorHandler.fatalErrors[0])
|
||||
return handler.result
|
||||
|
|
Loading…
Reference in New Issue