mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
zdtm.py: ignore utf-8 conversion errors in test logs
In zdtm/static/binfmt_misc we print the string which contains random
bytes, some of which may not map to utf-8. So let's ignore those bytes
we can't show in utf-8.
Else we can get:
File ".../criu/test/zdtm.py", line 660, in print_output
print(output.read())
~~~~~~~~~~~^^
File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 180: invalid continuation byte
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
parent
e6510a338a
commit
577c9a0f2f
1 changed files with 1 additions and 1 deletions
|
|
@ -656,7 +656,7 @@ class zdtm_test:
|
|||
for postfix in ['.out', '.out.inprogress']:
|
||||
if os.access(self.__name + postfix, os.R_OK):
|
||||
print("Test output: " + "=" * 32)
|
||||
with open(self.__name + postfix) as output:
|
||||
with open(self.__name + postfix, errors='ignore') as output:
|
||||
print(output.read())
|
||||
print(" <<< " + "=" * 32)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue