Skip to content

Commit f4ecd5e

Browse files
committed
handle chained url
1 parent 6e8aec7 commit f4ecd5e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/io/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,18 +1407,18 @@ def iterdir(
14071407

14081408
# Remote paths
14091409
fsspec = import_optional_dependency("fsspec", extra=scheme)
1410-
fs = fsspec.filesystem(scheme)
1411-
path_without_scheme = fsspec.core.strip_protocol(path_str)
1412-
if fs.isfile(path_without_scheme):
1410+
fs, inner_path = fsspec.core.url_to_fs(path_str)
1411+
if fs.isfile(inner_path):
1412+
path_obj = PurePosixPath(inner_path)
14131413
if _match_file(
1414-
path_without_scheme,
1414+
inner_path,
14151415
extensions,
14161416
glob,
14171417
):
14181418
return [path]
14191419

14201420
result = []
1421-
for file in fs.ls(path_without_scheme, detail=True):
1421+
for file in fs.ls(inner_path, detail=True):
14221422
if file["type"] == "file":
14231423
path_obj = PurePosixPath(file["name"])
14241424
if _match_file(

0 commit comments

Comments
 (0)