Bug 1727802 - skip invalid character in log handling. r=ahal
authorJoel Maher <jmaher@mozilla.com>
Fri, 03 Sep 2021 19:54:40 +0000
changeset 590997 3fd3c2745def8d2197f11b76c07f330c1bcf18b2
parent 590996 91da5c0edcc390ea2ae082952c2f35a71078cfa8
child 590998 14616096bc40dbbfe41f7dd366d167e6711e9c88
push id149186
push userjmaher@mozilla.com
push dateFri, 03 Sep 2021 19:58:43 +0000
treeherderautoland@3fd3c2745def [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1727802
milestone93.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 1727802 - skip invalid character in log handling. r=ahal Differential Revision: https://phabricator.services.mozilla.com/D123788
testing/mozbase/mozprocess/mozprocess/processhandler.py
--- a/testing/mozbase/mozprocess/mozprocess/processhandler.py
+++ b/testing/mozbase/mozprocess/mozprocess/processhandler.py
@@ -1284,17 +1284,17 @@ class StreamOutput(object):
 
     def __init__(self, stream, text=True):
         self.stream = stream
         self.text = text
 
     def __call__(self, line):
         ensure = six.ensure_text if self.text else six.ensure_binary
         try:
-            self.stream.write(ensure(line) + ensure("\n"))
+            self.stream.write(ensure(line, errors="ignore") + ensure("\n"))
         except TypeError:
             print(
                 "HEY! If you're reading this, you're about to encounter a "
                 "type error, probably as a result of a conversion from "
                 "Python 2 to Python 3. This is almost definitely because "
                 "you're trying to write binary data to a text-encoded "
                 "stream, or text data to a binary-encoded stream. Check how "
                 "you're instantiating your ProcessHandler and if the output "