Skip to content

Commit

Permalink
Merge pull request #17672 from bernt-matthias/topic/npz-sniff
Browse files Browse the repository at this point in the history
[23.2] Npz sniffing: do not read the whole file
  • Loading branch information
mvdbeek authored Mar 12, 2024
2 parents 17d015e + 117120c commit bd976d4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/galaxy/datatypes/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -4331,9 +4331,7 @@ def sniff(self, filename: str) -> bool:
try:
npz = np.load(filename)
if isinstance(npz, np.lib.npyio.NpzFile):
for f in npz.files:
if isinstance(npz[f], np.ndarray):
return True
return True
except Exception:
return False
return False
Expand Down

0 comments on commit bd976d4

Please sign in to comment.