Skip to content

Commit 2c8b7d9

Browse files
committed
ensure glob not applied to urls
1 parent 1132542 commit 2c8b7d9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

nctoolkit/api.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,6 @@ def open_data(x=[], checks=True, **kwargs):
466466
467467
"""
468468

469-
if type(x) is str:
470-
x = glob.glob(x)
471-
if len(x) == 0:
472-
raise FileNotFoundError("Please provide files that exist")
473-
474469
thredds = False
475470

476471
ftp_details = None
@@ -491,6 +486,13 @@ def open_data(x=[], checks=True, **kwargs):
491486
if key == "source":
492487
source = kwargs[key]
493488

489+
if type(x) is str and thredds is False:
490+
if is_url(x) is False:
491+
x = glob.glob(x)
492+
if len(x) == 0:
493+
raise FileNotFoundError("Please provide files that exist")
494+
495+
494496
# make sure data has been supplied
495497
if x is None:
496498
raise ValueError("No data was supplied!")

0 commit comments

Comments
 (0)