Skip to content

Commit 285094f

Browse files
authored
Exclude known non-FS kwargs in url_to_fs (#1316)
1 parent e64f0a1 commit 285094f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

fsspec/core.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,20 @@ def url_to_fs(url, **kwargs):
360360
urlpath : str
361361
The file-systems-specific URL for ``url``.
362362
"""
363+
# non-FS arguments that appear in fsspec.open()
364+
# inspect could keep this in sync with open()'s signature
365+
known_kwargs = {
366+
"auto_mkdir",
367+
"compression",
368+
"encoding",
369+
"errors",
370+
"expand",
371+
"mode",
372+
"name_function",
373+
"newline",
374+
"num",
375+
}
376+
kwargs = {k: v for k, v in kwargs.items() if k not in known_kwargs}
363377
chain = _un_chain(url, kwargs)
364378
inkwargs = {}
365379
# Reverse iterate the chain, creating a nested target_* structure

0 commit comments

Comments
 (0)