@@ -317,7 +317,7 @@ def get_thirdparty_packages(packages: list):
317
317
file .extractall (path = package_root_dir )
318
318
else :
319
319
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 )
321
321
# write version url to package_dir
322
322
with open (os .path .join (package_dir , "version.txt" ), "w" ) as f :
323
323
f .write (p .url )
@@ -365,10 +365,10 @@ def download_and_copy(name, src_func, dst_path, variable, version, url_func):
365
365
with open_url (url ) as response :
366
366
file_bytes = BytesIO (response .read ())
367
367
with zipfile .ZipFile (file_bytes , "r" ) as file :
368
- file .extractall (path = tmp_path , filter = "data" )
368
+ file .extractall (path = tmp_path )
369
369
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" )
372
372
os .makedirs (os .path .split (dst_path )[0 ], exist_ok = True )
373
373
print (f'copy { src_path } to { dst_path } ...' )
374
374
if os .path .isdir (src_path ):
0 commit comments