Skip to content

Commit 60c1158

Browse files
committed
correct suffix detection for scipy backend
1 parent 7ed1f0a commit 60c1158

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xarray/backends/scipy_.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,10 @@ def guess_can_open(
363363
return magic_number.startswith(b"CDF")
364364

365365
if isinstance(filename_or_obj, str | os.PathLike):
366-
_, ext = os.path.splitext(filename_or_obj)
367-
return ext in {".nc", ".cdf", ".nc.gz"}
366+
from pathlib import Path
367+
368+
suffix = "".join(Path(filename_or_obj).suffixes)
369+
return suffix in {".nc", ".cdf", ".nc.gz"}
368370

369371
return False
370372

0 commit comments

Comments
 (0)