Skip to content

Commit 0563c8d

Browse files
authored
Deal with MSys2 style paths (#509)
* Keep colon only for the drive letter part of MSYS2-style paths
1 parent aa51135 commit 0563c8d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/murfey/util/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ def secure_path(in_path: Path, keep_spaces: bool = False) -> Path:
7878
secure_filename(p) if " " not in p else p for p in in_path.parts
7979
]
8080
else:
81-
secured_parts = [secure_filename(p) for p in in_path.parts]
81+
secured_parts = [
82+
(
83+
secure_filename(part) + ":"
84+
if p == 0 and ":" in part
85+
else secure_filename(part)
86+
)
87+
for p, part in enumerate(in_path.parts)
88+
]
8289
return Path("/".join(secured_parts))
8390

8491

0 commit comments

Comments
 (0)