From 10cca7d0eab13dd820c901af0a24ad4c924554f4 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Mar 2026 19:46:00 -0600 Subject: [PATCH] fix(sanitize): restore parentheses stripping in filename sanitization (#93) Commit 6ce7b6c accidentally removed () from the unsafe-characters regex --- unshackle/core/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unshackle/core/utilities.py b/unshackle/core/utilities.py index b57ca14..c015459 100644 --- a/unshackle/core/utilities.py +++ b/unshackle/core/utilities.py @@ -136,7 +136,7 @@ def sanitize_filename(filename: str, spacer: str = ".") -> str: if spacer == ".": filename = re.sub(r" - ", spacer, filename) # title separators to spacer (avoids .-. pattern) filename = re.sub(r"[:; ]", spacer, filename) # structural chars to (spacer) - filename = re.sub(r"[\\*!?¿,'\"" "<>|$#~]", "", filename) # not filename safe chars + filename = re.sub(r"[\\*!?¿,'\"" "()<>|$#~]", "", filename) # not filename safe chars filename = re.sub(rf"[{spacer}]{{2,}}", spacer, filename) # remove extra neighbouring (spacer)s return filename