Skip to content

Commit b75b288

Browse files
committed
Need to check for colons that need putting back in to path names when there are spaces as well
1 parent b1d39ba commit b75b288

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/murfey/util/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,14 @@ def sanitise_nonpath(in_string: str) -> str:
7474

7575
def secure_path(in_path: Path, keep_spaces: bool = False) -> Path:
7676
if keep_spaces:
77-
secured_parts = [
78-
secure_filename(p) if " " not in p else p for p in in_path.parts
79-
]
77+
secured_parts = []
78+
for p, part in enumerate(in_path.parts):
79+
if " " in part:
80+
secured_parts.append(part)
81+
elif ":" in part and not p:
82+
secured_parts.append(secure_filename(part) + ":")
83+
else:
84+
secured_parts.append(secure_filename(part))
8085
else:
8186
secured_parts = [
8287
(

0 commit comments

Comments
 (0)