File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1343,6 +1343,7 @@ def iterdir(
13431343 path : FilePath | ReadCsvBuffer [bytes ] | ReadCsvBuffer [str ],
13441344 extensions : str | Iterable [str ] | None = None ,
13451345 glob : str | None = None ,
1346+ storage_options : StorageOptions | None = None ,
13461347) -> list [FilePath ] | ReadCsvBuffer [bytes ] | ReadCsvBuffer [str ]:
13471348 """Yield file paths in a directory (no nesting allowed).
13481349
@@ -1430,7 +1431,15 @@ def iterdir(
14301431
14311432 # Remote paths
14321433 fsspec = import_optional_dependency ("fsspec" , extra = scheme )
1433- fs , inner_path = fsspec .core .url_to_fs (path_str )
1434+
1435+ # GH #11071
1436+ # Two legacy S3 protocols (s3n and s3a) are replaced with s3
1437+ if path_str .startswith ("s3n://" ):
1438+ path_str = path_str .replace ("s3n://" , "s3://" )
1439+ if path_str .startswith ("s3a://" ):
1440+ path_str = path_str .replace ("s3a://" , "s3://" )
1441+
1442+ fs , inner_path = fsspec .core .url_to_fs (path_str , ** storage_options )
14341443 if fs .isfile (inner_path ):
14351444 path_obj = PurePosixPath (inner_path )
14361445 if _match_file (
Original file line number Diff line number Diff line change @@ -727,7 +727,8 @@ def _read(
727727
728728 extensions = kwds .get ("extensions" , None )
729729 glob = kwds .get ("glob" , None )
730- files = iterdir (filepath_or_buffer , extensions , glob )
730+ storage_options = kwds .get ("storage_options" , None )
731+ files = iterdir (filepath_or_buffer , extensions , glob , storage_options )
731732
732733 if isinstance (files , list ) and not files :
733734 raise FileNotFoundError (
You can’t perform that action at this time.
0 commit comments