Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-kan authored Mar 25, 2024
1 parent 8dcc5db commit 14291dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/spack/spack/util/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def _py_untar(archive_file: str, remove_archive_file: bool = False) -> str:
# also have other extensions (on Unix) such as tgz, tbz2, ...
archive_file = archive_file_no_ext + "-input"
shutil.move(archive_file_no_ext, archive_file)
tarfile.TarFile(archive_file).extractall()
f_tar = tarfile.TarFile(archive_file)
f_tar.extractall()
f_tar.close()
if remove_archive_file:
# remove input file to prevent two stage
# extractions from being treated as exploding
Expand Down Expand Up @@ -241,7 +243,9 @@ def _py_unzip(archive_file: str) -> str:
if archive_file_no_ext == archive_file:
archive_file = archive_file_no_ext + "-input"
shutil.move(archive_file_no_ext, archive_file)
zipfile.ZipFile(archive_file).extractall()
f_zip = zipfile.ZipFile(archive_file)
f_zip.extractall()
f_zip.close()
return outfile


Expand Down

0 comments on commit 14291dd

Please sign in to comment.