From 561e81df000d881c58d32d74009c9e463474a7b9 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 6 Apr 2020 02:04:48 +0200 Subject: [PATCH] Replace non utf8 errors properly in diff fuzzer --- test/fuzz_diff_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fuzz_diff_parser.py b/test/fuzz_diff_parser.py index 7e7098a..0a9bb97 100644 --- a/test/fuzz_diff_parser.py +++ b/test/fuzz_diff_parser.py @@ -197,7 +197,7 @@ class FileModification: class FileTests: def __init__(self, file_path, test_count, change_count): self._path = file_path - with open(file_path) as f: + with open(file_path, errors='replace') as f: code = f.read() self._code_lines = split_lines(code, keepends=True) self._test_count = test_count