Bug 1359292 - Handle non-ascii characters in reftest logs; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Mon, 08 May 2017 07:49:05 -0600
changeset 357094 66c34adec7e9651e1e49202352b84fd85797bfd7
parent 357093 522b93c51537d2998bc79ff1a50624a7f707c423
child 357095 b99cdf171a9b0f01b3018266d656af50d5273d2d
push id31782
push userkwierso@gmail.com
push dateMon, 08 May 2017 23:07:35 +0000
treeherdermozilla-central@b21b974d60d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1359292
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359292 - Handle non-ascii characters in reftest logs; r=jmaher Non-ascii characters in error messages can cause exceptions when processing structured log messages. The mochitest MessageLogger already handles such cases; this is a simpler implementation for the reftest OutputHandler.
layout/tools/reftest/output.py
--- a/layout/tools/reftest/output.py
+++ b/layout/tools/reftest/output.py
@@ -104,16 +104,17 @@ class OutputHandler(object):
     def __init__(self, log, utilityPath, symbolsPath=None):
         self.stack_fixer_function = get_stack_fixer_function(utilityPath, symbolsPath)
         self.log = log
 
     def __call__(self, line):
         # need to return processed messages to appease remoteautomation.py
         if not line.strip():
             return []
+        line = line.decode('utf-8', errors='replace')
 
         try:
             data = json.loads(line)
         except ValueError:
             self.verbatim(line)
             return [line]
 
         if isinstance(data, dict) and 'action' in data: