From 46b956ce7c6ed3a77a25edb5bed26dbc4b3b2f9f Mon Sep 17 00:00:00 2001 From: 95833 <987004590@qq.com> Date: Tue, 10 Dec 2024 16:23:03 +0800 Subject: [PATCH] Update url.py to fit WSL path that starts with "\\wsl.local" --- plugin/core/url.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/core/url.py b/plugin/core/url.py index 75c3f6235..3a17fe6c0 100644 --- a/plugin/core/url.py +++ b/plugin/core/url.py @@ -56,7 +56,8 @@ def parse_uri(uri: str) -> tuple[str, str]: path = url2pathname(parsed.path) if os.name == 'nt': netloc = url2pathname(parsed.netloc) - path = path.lstrip("\\") + if path[0] == '\\': + path = path[1:] path = re.sub(r"^/([a-zA-Z]:)", r"\1", path) # remove slash preceding drive letter path = re.sub(r"^([a-z]):", _uppercase_driveletter, path) if netloc: