From 1a9b38276ed1b8a0971c0077e4c0a29e14167f8d Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Fri, 1 Dec 2023 14:21:39 +0100 Subject: [PATCH] Properly decode binary data --- tested/judge/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tested/judge/utils.py b/tested/judge/utils.py index cd7f184e..4ce85f37 100644 --- a/tested/judge/utils.py +++ b/tested/judge/utils.py @@ -60,8 +60,8 @@ def run_command( ) except subprocess.TimeoutExpired as e: return BaseExecutionResult( - stdout=str(e.stdout or ""), - stderr=str(e.stderr or ""), + stdout=e.stdout.decode("utf-8", "backslashreplace") if e.stdout else "", + stderr=e.stderr.decode("utf-8", "backslashreplace") if e.stderr else "", exit=0, timeout=True, memory=False,