Do not collapse directory structure when sanitizing

This commit is contained in:
I-Al-Istannen 2020-11-10 22:53:47 +01:00
parent 733e1ae136
commit 1486a63854

View File

@ -21,7 +21,7 @@ from PFERD.utils import to_path
def sanitize_path(path: PurePath) -> Optional[PurePath]:
# Escape windows illegal path characters
if os.name == 'nt':
return PurePath(re.sub(r'[<>:"/\\|?]', "_", str(path)))
return PurePath(re.sub(r'[<>:"/|?]', "_", str(path)))
return path