Skip to content

Commit 7acc532

Browse files
Gumixylobankov
authored andcommitted
Follow-up fix for parsing non-utf8 chars (part 2)
This patch is similar to commit 52d3e4f ("Follow-up fix for parsing non-utf8 chars"), but fixes the `--verbose` output, e.g.: ``` $ ./test-run.py --verbose some_test [...] [001] Worker "001_xxx-luatest" received the following error; stopping... [001] Traceback (most recent call last): [001] File "./tarantool/test-run/lib/worker.py", line 357, in run_task [001] short_status, duration = self.suite.run_test( [001] ^^^^^^^^^^^^^^^^^^^^ [001] File "./tarantool/test-run/lib/test_suite.py", line 271, in run_test [001] short_status = test.run(server) [001] ^^^^^^^^^^^^^^^^ [001] File "./tarantool/test-run/lib/test.py", line 232, in run [001] color_stdout(f.read(), schema='log') [001] ^^^^^^^^ [001] File "<frozen codecs>", line 322, in decode [001] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 115111: invalid start byte [001] [001] Exception: 'utf-8' codec can't decode byte 0xa3 in position 115111: invalid start byte ```
1 parent 5d9630b commit 7acc532

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ def run(self, server):
228228
elif self.is_executed_ok:
229229
if Options().args.is_verbose:
230230
color_stdout('\n')
231-
with open(self.tmp_result, 'r') as f:
231+
with open(self.tmp_result, 'r', encoding='utf-8',
232+
errors='replace') as f:
232233
color_stdout(f.read(), schema='log')
233234
is_tap, is_ok, is_skip = self.check_tap_output()
234235
self.is_equal_result = is_ok

0 commit comments

Comments
 (0)