Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
virusdefender committed Nov 17, 2018
1 parent a35ebd1 commit f9af521
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/judge_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def _get_test_case_file_info(self, test_case_file_id):

def _compare_output(self, test_case_file_id):
user_output_file = os.path.join(self._submission_dir, str(test_case_file_id) + ".out")
with open(user_output_file, "r", encoding="utf-8") as f:
with open(user_output_file, "rb") as f:
content = f.read()
output_md5 = hashlib.md5(content.rstrip().encode("utf-8")).hexdigest()
output_md5 = hashlib.md5(content.rstrip()).hexdigest()
result = output_md5 == self._get_test_case_file_info(test_case_file_id)["stripped_output_md5"]
return output_md5, result

Expand Down

0 comments on commit f9af521

Please sign in to comment.