Skip to content

Commit

Permalink
Using tarfile extract filter as None in python without tar_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tfmoraes committed Sep 25, 2024
1 parent e4dda58 commit 02b2696
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion invesalius/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,9 @@ def Extract(filename: Union[str, bytes, os.PathLike], folder: Union[str, bytes,
idir = decode(os.path.split(tar.getnames()[0])[0], "utf8")
os.mkdir(os.path.join(folder, idir))
filelist = []
tar_filter = getattr(tarfile, "tar_filter", None) # For python < 3.12
for t in tar.getmembers():
tar.extract(t, path=folder, filter=tarfile.tar_filter)
tar.extract(t, path=folder, filter=tar_filter)
fname = os.path.join(folder, decode(t.name, "utf-8"))
filelist.append(fname)
tar.close()
Expand Down

0 comments on commit 02b2696

Please sign in to comment.