Skip to content

Commit

Permalink
Set extractall filter for tarfile
Browse files Browse the repository at this point in the history
See
https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractall

Signed-off-by: William Douglas <william.douglas@intel.com>
  • Loading branch information
bryteise committed Nov 4, 2024
1 parent 9bfe801 commit e822d6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autospec/tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def extract(self, base_path):
def extract_tar(self, extraction_path):
"""Extract tar in path."""
with tarfile.open(self.path) as content:
content.extractall(path=extraction_path)
content.extractall(path=extraction_path, filter='data')

def extract_bz2(self, extraction_path):
"""Extract plain bz2 file in path."""
Expand All @@ -144,7 +144,7 @@ def extract_zip(self, extraction_path):
def extract_zst(self, extraction_path):
"""Extract zst in path."""
with tarfile.open(fileobj=zstd.open(self.path, 'rb'), mode='r|') as content:
content.extractall(path=extraction_path)
content.extractall(path=extraction_path, filter='data')


def convert_version(ver_str, name):
Expand Down

0 comments on commit e822d6e

Please sign in to comment.