Skip to content

Commit a70e10d

Browse files
authored
Fix glob pattern when gcs url path has a trailing slash (#406)
1 parent 4c3f1e7 commit a70e10d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

img2dataset/reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(
5757
self.tmp_path = tmp_path
5858

5959
if fs.isdir(url_path):
60-
self.input_files = sorted(fs.glob(url_path + "/*." + input_format))
60+
self.input_files = sorted(fs.glob(url_path.rstrip("/") + "/*." + input_format))
6161
if len(self.input_files) == 0:
6262
raise ValueError(f"No file found at path {url_path} with extension {input_format}")
6363
else:

0 commit comments

Comments
 (0)