From 52d3e4f7c90f72658ed62cd0ebfc929877e8a018 Mon Sep 17 00:00:00 2001 From: Serge Petrenko Date: Wed, 24 Jul 2024 19:27:24 +0300 Subject: [PATCH] Follow-up fix for parsing non-utf8 chars Previous attempt to fix this in commit 72905405cebe ("tap13: fix parsing non-utf8 chars") didn't take into account the hung test reporter, which also reads the result file in order to report how many lines into the result the test hung. Fix this as well. Closes #442 --- listeners.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/listeners.py b/listeners.py index bba95781..11c5601b 100644 --- a/listeners.py +++ b/listeners.py @@ -459,7 +459,7 @@ def process_timeout(self, delta_seconds): result_file = task.task_tmp_result result_file_summary = '(no result file {})'.format(result_file) if os.path.exists(result_file): - with open(result_file, 'r') as f: + with open(result_file, 'r', encoding='utf-8', errors='replace') as f: lines = sum(1 for _ in f) result_file_summary = 'at {}:{}'.format(result_file, lines)