diff --git a/problemtools/verifyproblem.py b/problemtools/verifyproblem.py index ccd09ef8..f2e91304 100644 --- a/problemtools/verifyproblem.py +++ b/problemtools/verifyproblem.py @@ -1166,9 +1166,12 @@ def collect_flags(group: TestCaseGroup, flags: set[str]) -> None: def modified_input_validates(applicable, modifier): for testcase in self.problem.testdata.get_all_testcases(): - with open(testcase.infile) as infile: - infile_data = infile.read() - if not applicable(infile_data): + try: + with open(testcase.infile) as infile: + infile_data = infile.read() + if not applicable(infile_data): + continue + except UnicodeDecodeError: continue with open(file_name, 'wb') as f: