Skip to content

Commit

Permalink
Fix glob pattern when gcs url path has a trailing slash (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
kafonek committed Feb 22, 2024
1 parent 4c3f1e7 commit a70e10d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion img2dataset/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
self.tmp_path = tmp_path

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

0 comments on commit a70e10d

Please sign in to comment.