From b92bc3e01a7201889e9f8d9730fd1969d0c1f765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Tue, 22 Mar 2022 18:40:08 +0545 Subject: [PATCH] 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. --- dvc/fs/webdav.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dvc/fs/webdav.py b/dvc/fs/webdav.py index 7540a4c5d..0eac67867 100644 --- a/dvc/fs/webdav.py +++ b/dvc/fs/webdav.py @@ -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