Skip to content

Commit

Permalink
Merge pull request #851 from tfmoraes/tarfilter_older_python
Browse files Browse the repository at this point in the history
Using tarfile extract filter as None in python without tar_filter
  • Loading branch information
rmatsuda authored Sep 25, 2024
2 parents d064798 + 02b2696 commit 439bbbc
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 439bbbc

Please sign in to comment.