From e97311827c3a758c4af438182b79e047219eed98 Mon Sep 17 00:00:00 2001 From: Yaohui Wang Date: Mon, 15 May 2023 23:19:34 +0800 Subject: [PATCH 1/2] fix: reset `os.getcwd` system call after sandbox execution - Reset `os.getcwd()` after sandbox execution, since it is invoked by `create_tempdir()` --- human_eval/execution.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/human_eval/execution.py b/human_eval/execution.py index bc509f5..2fd7bd5 100644 --- a/human_eval/execution.py +++ b/human_eval/execution.py @@ -30,6 +30,8 @@ def unsafe_execute(): rmtree = shutil.rmtree rmdir = os.rmdir chdir = os.chdir + getcwd = os.getcwd + # Disable functionalities that can make destructive changes to the test. reliability_guard() @@ -66,6 +68,8 @@ def unsafe_execute(): shutil.rmtree = rmtree os.rmdir = rmdir os.chdir = chdir + os.getcwd = getcwd + manager = multiprocessing.Manager() result = manager.list() From b8cf7da8d5493cfcb1233af6aec97f949ee9a1b7 Mon Sep 17 00:00:00 2001 From: Yaohui Wang Date: Mon, 15 May 2023 23:21:45 +0800 Subject: [PATCH 2/2] Update execution.py - remove blank lines --- human_eval/execution.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/human_eval/execution.py b/human_eval/execution.py index 2fd7bd5..3fe977a 100644 --- a/human_eval/execution.py +++ b/human_eval/execution.py @@ -32,7 +32,6 @@ def unsafe_execute(): chdir = os.chdir getcwd = os.getcwd - # Disable functionalities that can make destructive changes to the test. reliability_guard() @@ -70,7 +69,6 @@ def unsafe_execute(): os.chdir = chdir os.getcwd = getcwd - manager = multiprocessing.Manager() result = manager.list()