From 1ecd318890bedb98ce1f2851a1bedfe97018f9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=B6hler?= Date: Mon, 15 Apr 2024 14:34:22 +0200 Subject: [PATCH] don't normalize paths in expand_path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove normalizing paths in "expand_path" and expand environment variables. Paths don't need to be normalized, but doing this on non-path parameters (i.e. URLs) might cause bugs. Reported-by: s-hamann Closes: https://github.com/pimutils/vdirsyncer/issues/1021 Signed-off-by: Thomas Böhler --- vdirsyncer/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vdirsyncer/utils.py b/vdirsyncer/utils.py index 2e0fd9ce..afad63c5 100644 --- a/vdirsyncer/utils.py +++ b/vdirsyncer/utils.py @@ -20,9 +20,9 @@ def expand_path(p: str) -> str: - """Expand $HOME in a path and normalise slashes.""" + """Expand $HOME/~(user) and environment variables in a path.""" p = os.path.expanduser(p) - p = os.path.normpath(p) + p = os.path.expandvars(p) return p