From 4c36f572f22e8f17b9f16baf1752d3260bcc1f69 Mon Sep 17 00:00:00 2001 From: savish28 <32800267+savish28@users.noreply.github.com> Date: Sat, 21 Aug 2021 23:57:45 +0530 Subject: [PATCH] [BugFix] Encode stderr and stdout with utf-8 in update submission API --- apps/jobs/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/jobs/views.py b/apps/jobs/views.py index fcfe8c4b7c..b21fff2f1f 100644 --- a/apps/jobs/views.py +++ b/apps/jobs/views.py @@ -1111,8 +1111,8 @@ def update_submission(request, challenge_pk): challenge_phase_pk = request.data.get("challenge_phase") submission_pk = request.data.get("submission") submission_status = request.data.get("submission_status", "").lower() - stdout_content = request.data.get("stdout", "") - stderr_content = request.data.get("stderr", "") + stdout_content = request.data.get("stdout", "").encode("utf-8") + stderr_content = request.data.get("stderr", "").encode("utf-8") submission_result = request.data.get("result", "") metadata = request.data.get("metadata", "") submission = get_submission_model(submission_pk)