mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-01 12:45:34 +00:00
Merge pull request #7605 from ThomasWaldmann/fix-_resolve_path
fix borg.remote._resolve_path
This commit is contained in:
commit
85b6126629
1 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,6 @@
|
|||
from .constants import * # NOQA
|
||||
from .helpers import Error, IntegrityError
|
||||
from .helpers import bin_to_hex
|
||||
from .helpers import get_base_dir
|
||||
from .helpers import get_limited_unpacker
|
||||
from .helpers import replace_placeholders
|
||||
from .helpers import sysinfo
|
||||
|
@ -255,7 +254,8 @@ def _resolve_path(self, path):
|
|||
if isinstance(path, bytes):
|
||||
path = os.fsdecode(path)
|
||||
if path.startswith("/~/"): # /~/x = path x relative to own home dir
|
||||
path = os.path.join(get_base_dir(), path[3:])
|
||||
home_dir = os.environ.get("HOME") or os.path.expanduser("~%s" % os.environ.get("USER", ""))
|
||||
path = os.path.join(home_dir, path[3:])
|
||||
elif path.startswith("/./"): # /./x = path x relative to cwd
|
||||
path = path[3:]
|
||||
return os.path.realpath(path)
|
||||
|
|
Loading…
Reference in a new issue