From 30fb38f52ed5121dbd3f94de077f793afb9a82a8 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Fri, 28 Apr 2023 20:53:54 -0500 Subject: [PATCH] Show error in output instead of exception --- judge/utils/problem_data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/judge/utils/problem_data.py b/judge/utils/problem_data.py index 782e4af..8be05ae 100644 --- a/judge/utils/problem_data.py +++ b/judge/utils/problem_data.py @@ -335,7 +335,9 @@ def get_problem_case(problem, files): if next_char: s += next_char else: - raise Exception("File %s is not able to decode in utf-8" % file) + s = f"File {file} is not able to decode in utf-8" + s = s.encode("utf-8") + break qs = get_visible_content(s) cache.set(cache_key, qs, 86400) result[file] = qs