Skip to content

Commit

Permalink
set a no-op filter if extraction filter is supported (Python 3.12+)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed Feb 13, 2025
1 parent 4321b31 commit 1dbc0d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jupyter_scheduler/job_files_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ def download_tar(self, archive_format: str = "tar"):

with fsspec.open(archive_filepath) as f:
with tarfile.open(fileobj=f, mode=read_mode) as tar:
# if extraction filter is supported (Python 3.12+), set a no-op filter
if hasattr(tar, "extraction_filter"):
tar.extraction_filter = lambda member, path: member

tar.extractall(self.output_dir)

def download(self):
Expand Down

0 comments on commit 1dbc0d6

Please sign in to comment.