Skip to content

Commit

Permalink
FIX: condition for old python tarfile (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmatsuda authored Sep 27, 2024
1 parent 560153a commit 8a97f49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion invesalius/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ def Extract(filename: Union[str, bytes, os.PathLike], folder: Union[str, bytes,
filelist = []
tar_filter = getattr(tarfile, "tar_filter", None) # For python < 3.12
for t in tar.getmembers():
tar.extract(t, path=folder, filter=tar_filter)
try:
tar.extract(t, path=folder, filter=tar_filter)
except TypeError:
tar.extract(t, path=folder)
fname = os.path.join(folder, decode(t.name, "utf-8"))
filelist.append(fname)
tar.close()
Expand Down

0 comments on commit 8a97f49

Please sign in to comment.