Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
glemaitre committed Oct 5, 2024
1 parent 28328fa commit 4e38f66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion imblearn/datasets/_zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

import tarfile
from collections import OrderedDict
from inspect import signature
from io import BytesIO
from os import makedirs
from os.path import isfile, join
Expand Down Expand Up @@ -279,7 +280,10 @@ def fetch_datasets(
print("Downloading %s" % URL)
f = BytesIO(urlopen(URL).read())
tar = tarfile.open(fileobj=f)
tar.extractall(path=zenodo_dir)
if "filter" in signature(tar.extractall).parameters:
tar.extractall(path=zenodo_dir, filter="data")
else: # Python < 3.12
tar.extractall(path=zenodo_dir)
elif not download_if_missing and not available:
raise IOError("Data not found and `download_if_missing` is False")

Expand Down

0 comments on commit 4e38f66

Please sign in to comment.