From 25ebb5d927a59b3efacf898e17e63b6e347e0f59 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 2 Sep 2025 11:45:14 -0400 Subject: [PATCH] Revert "Sanitize ~ in pathname (we do not use/rely on ~ ATM)" This reverts commit 1609da8e29451801e17dc77e0a8a61f8679359cb. It was not the reason and `~` is a legit character so I do not see the need to change behavior ATM. Continuing on - https://github.com/con/tinuous/issues/215 - https://github.com/bids-standard/bids-validator/issues/248 --- src/tinuous/util.py | 2 +- test/test_util.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tinuous/util.py b/src/tinuous/util.py index 19a8303..ba8b751 100644 --- a/src/tinuous/util.py +++ b/src/tinuous/util.py @@ -133,7 +133,7 @@ def get_github_token() -> str: def sanitize_pathname(s: str) -> str: return re.sub( - r'[\0\x5C/<>:|"?*%~]', lambda m: sanitize_str(m.group()), re.sub(r"\s", " ", s) + r'[\0\x5C/<>:|"?*%]', lambda m: sanitize_str(m.group()), re.sub(r"\s", " ", s) ) diff --git a/test/test_util.py b/test/test_util.py index 8b29667..bfb6662 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -143,7 +143,6 @@ def test_removeprefix(s: str, prefix: str, result: str) -> None: ('"foo"', "%22foo%22"), ("foo?", "foo%3f"), ("foo*bar", "foo%2abar"), - ("foo~bar", "foo%7ebar"), ("foo%20bar", "foo%2520bar"), ("foo\0bar", "foo%00bar"), ],