Skip to content

Commit

Permalink
Relax typing check for invocation of shutil there
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Oct 28, 2024
1 parent c1c09b4 commit bf404c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions heudiconv/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ def get_extracted_dicoms(fl: Iterable[str]) -> ItemsView[Optional[str], list[str
os.chmod(tmpdir, mode=0o700)
# For tar (only!) starting with 3.12 we should provide filter
# (enforced in 3.14) on how to filter/safe-guard filenames.
kws = {}
kws: dict[str, str] = {}
if sys.version_info >= (3, 12) and t.endswith(_TAR_UNPACK_FORMATS):
# Allow for a user-workaround if would be desired
# see e.g. https://docs.python.org/3.12/library/tarfile.html#extraction-filters
kws["filter"] = os.environ.get("HEUDICONV_TAR_FILTER", "tar")

Check warning on line 148 in heudiconv/parser.py

View check run for this annotation

Codecov / codecov/patch

heudiconv/parser.py#L148

Added line #L148 was not covered by tests
shutil.unpack_archive(t, extract_dir=tmpdir, **kws)
shutil.unpack_archive(t, extract_dir=tmpdir, **kws) # type: ignore[arg-type]

archive_content = list(find_files(regex=".*", topdir=tmpdir))

Expand Down

0 comments on commit bf404c8

Please sign in to comment.