From 4ac51048c115e2dfc4c04228cda65b4c16346daf Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Tue, 10 Nov 2020 20:49:14 +0100 Subject: [PATCH] Use "_" as a replacement for illegal characters --- sync_url.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sync_url.py b/sync_url.py index cb837a2..ebb635b 100755 --- a/sync_url.py +++ b/sync_url.py @@ -15,14 +15,13 @@ from PFERD import Pferd from PFERD.cookie_jar import CookieJar from PFERD.ilias import (IliasCrawler, IliasElementType, KitShibbolethAuthenticator) -from PFERD.transform import re_rename 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