Skip to content

Commit 1089161

Browse files
authored
Skip UTF8 errors. (#41821)
1 parent 791f872 commit 1089161

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

scripts/tests/local.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,8 @@ def as_runner(path):
997997
f.write(result.stderr)
998998

999999
else:
1000-
logging.info("STDOUT:\n%s", result.stdout.decode("utf8"))
1001-
logging.warning("STDERR:\n%s", result.stderr.decode("utf8"))
1000+
logging.info("STDOUT:\n%s", result.stdout.decode("utf8", errors='replace'))
1001+
logging.warning("STDERR:\n%s", result.stderr.decode("utf8", errors='replace'))
10021002
if not keep_going:
10031003
sys.exit(1)
10041004
failed_tests.append(script)

scripts/tests/run_python_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def main_impl(app: str, factory_reset: bool, factory_reset_app_only: bool, app_a
333333

334334
if quiet:
335335
if exit_code:
336-
sys.stdout.write(stream_output.getvalue().decode('utf-8'))
336+
sys.stdout.write(stream_output.getvalue().decode('utf-8', errors='replace'))
337337
else:
338338
logging.info("Test completed successfully")
339339

scripts/tools/esp32_log_cat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def Log(self, raw):
6464

6565
if raw.startswith(b'\x1b['):
6666
raw = raw[raw.find(b'm')+1:]
67-
raw = raw.decode('utf8').strip()
67+
raw = raw.decode('utf8', errors='replace').strip()
6868

6969
self.ExtractSeverity(raw)
7070

0 commit comments

Comments
 (0)