Open
Description
I am currently developing a fsspec driver for a filesystem protocol that does not need/have an authority, such that:
URI = protocol ":" path
is a valid URI.
However, fsspec's split_protocol
function seems to assume that an authority is always given, i.e.:
URI = protocol ":" "//" authority path
filesystem_spec/fsspec/core.py
Lines 548 to 558 in 6b85a47
The only exceptions are data
(see above) and indirectly file
(see here) which are handled specifically.
Are there any issues with supporting also protocols without //authority
? E.g. could we just change split_protocol
to something like:
def split_protocol(urlpath):
"""Return protocol, path pair"""
urlpath = stringify_path(urlpath)
if "://" in urlpath:
protocol, path = urlpath.split("://", 1)
if len(protocol) > 1:
# excludes Windows paths
return protocol, path
elif ":/" in urlpath:
protocol, path = urlpath.split(":/", 1)
if len(protocol) > 1:
path = "/" + path
return protocol, path
if urlpath.startswith("data:"):
return urlpath.split(":", 1)
return None, urlpath
Metadata
Metadata
Assignees
Labels
No labels