diff --git a/src/tinuous/util.py b/src/tinuous/util.py index ba8b751..19a8303 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 bfb6662..8b29667 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -143,6 +143,7 @@ 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"), ],