Skip to content

Commit 1b17260

Browse files
committed
christen: remove cross-platform path sep
1 parent 483a8d9 commit 1b17260

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

library/utils/path_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def clean_path(b, max_name_len=255, dot_space=False, case_insensitive=False, low
4343
ext = path.suffix
4444

4545
pre = ""
46-
if path.drive and path.drive.endswith(":"):
46+
if str(path).startswith(os.sep):
47+
pre = os.sep
48+
path = Path(str(path)[len(os.sep) :])
49+
elif path.drive and path.drive.endswith(":"):
4750
pre = path.drive
4851
path = Path(str(path)[len(path.drive) :])
4952

library/utils/strings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ def clean_string(p) -> str:
137137
.replace(":", "")
138138
.replace(">", "")
139139
.replace("<", "")
140+
.replace("\\", "")
141+
.replace("/", "")
140142
)
141143
p = remove_consecutives(p, chars=["."])
142144
p = (

0 commit comments

Comments
 (0)