fs.webdav: consider url/path to be root

Webdav filesystem expects path to be relative
to the base url, instead of having full prefix.

So we are setting it to "" (root) through `_strip_protocol`
which converts fully-qualified name to the file-system
specific path.
This commit is contained in:
Saugat Pachhai (सौगात)
2022-03-25 13:56:33 +02:00
committed by Ruslan Kuprieiev
parent c08aa4a93b
commit b92bc3e01a
+5 -3
View File
@@ -35,9 +35,11 @@ class WebDAVFileSystem(FSSpecWrapper): # pylint:disable=abstract-method
@classmethod
def _strip_protocol(cls, path: str) -> str:
from fsspec.utils import infer_storage_options
return infer_storage_options(path)["path"].lstrip("/")
"""
For WebDAVFileSystem, provided url is the base path itself, so it
should be treated as being a root path.
"""
return ""
def unstrip_protocol(self, path: str) -> str:
return self.fs_args["base_url"] + "/" + path