We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0e5d6b commit b5b50d4Copy full SHA for b5b50d4
domdf_python_tools/paths.py
@@ -48,6 +48,7 @@
48
import json
49
import os
50
import pathlib
51
+import platform
52
import shutil
53
import stat
54
import sys
@@ -851,7 +852,12 @@ def from_uri(cls: Type[_PP], uri: str) -> _PP:
851
852
if parseresult.netloc or parseresult.params or parseresult.query or parseresult.fragment:
853
raise ValueError("Malformed file URI")
854
- return cls(urllib.parse.unquote_to_bytes(parseresult.path).decode("UTF-8"))
855
+ path = urllib.parse.unquote_to_bytes(parseresult.path).decode("UTF-8")
856
+
857
+ if os.name == "nt":
858
+ path = path.lstrip('/')
859
860
+ return cls(path)
861
862
863
class PosixPathPlus(PathPlus, pathlib.PurePosixPath):
0 commit comments