From 577c9a0f2fbd069ce79967db2d6d036744fa865b Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Tue, 3 Feb 2026 20:33:50 +0100 Subject: [PATCH] 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 "", line 325, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 180: invalid continuation byte Signed-off-by: Pavel Tikhomirov --- test/zdtm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/zdtm.py b/test/zdtm.py index e21356c30..69ae8d405 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -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)