Skip to content

Commit 6fa0356

Browse files
committed
extract using tar command
Avoid using `tarfile` module to workaround DEVPROD-24663.
1 parent bd6decb commit 6fa0356

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.evergreen/scripts/setup_tests.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ def setup_libmongocrypt():
117117
LOGGER.info(f"Fetching {url}...")
118118
with request.urlopen(request.Request(url), timeout=15.0) as response: # noqa: S310
119119
if response.status == 200:
120-
fileobj = io.BytesIO(response.read())
121-
with tarfile.open("libmongocrypt.tar.gz", fileobj=fileobj) as fid:
122-
fid.extractall(Path.cwd() / "libmongocrypt")
120+
with Path("libmongocrypt.tar.gz").open("wb") as f:
121+
f.write(response.read())
122+
Path("libmongocrypt").mkdir()
123+
run_command("tar -xzf libmongocrypt.tar.gz -C libmongocrypt")
123124
LOGGER.info(f"Fetching {url}... done.")
124125

125126
run_command("ls -la libmongocrypt")

0 commit comments

Comments
 (0)