From 667eb96ff6c2ae509dba00855e4b28bd1bc947c5 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Fri, 22 Dec 2017 00:25:54 +0800 Subject: [PATCH] fix encoding --- server/compiler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/compiler.py b/server/compiler.py index 5f6616f..3a4a03e 100644 --- a/server/compiler.py +++ b/server/compiler.py @@ -24,11 +24,11 @@ class Compiler(object): max_stack=128 * 1024 * 1024, max_output_size=1024 * 1024, max_process_number=_judger.UNLIMITED, - exe_path=_command[0], + exe_path=_command[0].encode("utf-8"), # /dev/null is best, but in some system, this will call ioctl system call - input_path=src_path, - output_path=compiler_out, - error_path=compiler_out, + input_path=src_path.encode("utf-8"), + output_path=compiler_out.encode("utf-8"), + error_path=compiler_out.encode("utf-8"), args=[item.encode("utf-8") for item in _command[1::]], env=[("PATH=" + os.getenv("PATH")).encode("utf-8")], log_path=COMPILER_LOG_PATH,