From 413a5dd1672e98af86469095054fc31e9f441761 Mon Sep 17 00:00:00 2001 From: yuxqiu Date: Sun, 28 Jul 2024 20:34:48 +0800 Subject: [PATCH] fix: remove incorrect `exec_run` calls --- swebench/harness/docker_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/swebench/harness/docker_utils.py b/swebench/harness/docker_utils.py index dd8037ee..a3581b84 100644 --- a/swebench/harness/docker_utils.py +++ b/swebench/harness/docker_utils.py @@ -32,7 +32,7 @@ def copy_to_container(container: Container, src: Path, dst: Path): # temporary tar file tar_path = src.with_suffix(".tar") with tarfile.open(tar_path, "w") as tar: - tar.add(src, arcname=src.name) + tar.add(src, arcname=dst.name) # use destination name, so after `put_archive`, name is correct # get bytes for put_archive cmd with open(tar_path, "rb") as tar_file: @@ -43,11 +43,9 @@ def copy_to_container(container: Container, src: Path, dst: Path): # Send tar file to container and extract container.put_archive(os.path.dirname(dst), data) - container.exec_run(f"tar -xf {dst}.tar -C {dst.parent}") # clean up in locally and in container tar_path.unlink() - container.exec_run(f"rm {dst}.tar") def write_to_container(container: Container, data: str, dst: Path):