Skip to content

Commit a575aa2

Browse files
[WIN] Use zip extension
Signed-off-by: Whitney Tsang <whitney.tsang@intel.com>
1 parent f3f0541 commit a575aa2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def get_thirdparty_packages(packages: list):
317317
file.extractall(path=package_root_dir)
318318
else:
319319
with tarfile.open(fileobj=response, mode="r|*") as file:
320-
file.extractall(path=package_root_dir, filter="data")
320+
file.extractall(path=package_root_dir)
321321
# write version url to package_dir
322322
with open(os.path.join(package_dir, "version.txt"), "w") as f:
323323
f.write(p.url)
@@ -365,10 +365,10 @@ def download_and_copy(name, src_func, dst_path, variable, version, url_func):
365365
with open_url(url) as response:
366366
file_bytes = BytesIO(response.read())
367367
with zipfile.ZipFile(file_bytes, "r") as file:
368-
file.extractall(path=tmp_path, filter="data")
368+
file.extractall(path=tmp_path)
369369
else:
370-
file = tarfile.open(fileobj=open_url(url), mode="r|*")
371-
file.extractall(path=tmp_path, filter="data")
370+
with open_url(url) as url_file, tarfile.open(fileobj=url_file, mode="r|*") as tar_file:
371+
tar_file.extractall(path=tmp_path, filter="data")
372372
os.makedirs(os.path.split(dst_path)[0], exist_ok=True)
373373
print(f'copy {src_path} to {dst_path} ...')
374374
if os.path.isdir(src_path):

0 commit comments

Comments
 (0)