Skip to content

Commit

Permalink
don't normalize paths in expand_path
Browse files Browse the repository at this point in the history
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: pimutils#1021
Signed-off-by: Thomas Böhler <[email protected]>
  • Loading branch information
Witcher01 committed Apr 15, 2024
1 parent a513a7e commit 1ecd318
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vdirsyncer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 1ecd318

Please sign in to comment.