diff --git a/lib/spack/spack/util/compression.py b/lib/spack/spack/util/compression.py index 419e423..7f9e130 100644 --- a/lib/spack/spack/util/compression.py +++ b/lib/spack/spack/util/compression.py @@ -242,7 +242,7 @@ def _py_untar(archive_file: str, remove_archive_file: bool = False) -> str: shutil.move(archive_file_no_ext, archive_file) f_tar = tarfile.open(archive_file) f_members = [_data_filter(member=m, dest_path=outfile) for m in f_tar.getmembers()] - f_tar.extractall(members=f_members) + f_tar.extractall(path=outfile, members=f_members) f_tar.close() if remove_archive_file: # remove input file to prevent two stage @@ -398,7 +398,7 @@ def _py_unzip(archive_file: str) -> str: archive_file = archive_file_no_ext + "-input" shutil.move(archive_file_no_ext, archive_file) f_zip = zipfile.ZipFile(archive_file) - f_zip.extractall() + f_zip.extractall(path=outfile) return outfile