From 13f20647dcad97f2726fa2fac8ebcad92a9a19df Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 6 Sep 2015 23:26:47 +0200 Subject: [PATCH] use absolute path, attic issue #200, attic issue #137 the daemonize code changes the cwd, thus a relative repo path can't work. borg mount repo mnt # did not work borg mount --foreground repo mnt # did work borg mount /abs/path/repo mnt # did work --- borg/repository.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/borg/repository.py b/borg/repository.py index 559a87d87..f43161fb6 100644 --- a/borg/repository.py +++ b/borg/repository.py @@ -50,14 +50,14 @@ class Repository: """Object with key {} not found in repository {}.""" def __init__(self, path, create=False, exclusive=False): - self.path = path + self.path = os.path.abspath(path) self.io = None self.lock = None self.index = None self._active_txn = False if create: - self.create(path) - self.open(path, exclusive) + self.create(self.path) + self.open(self.path, exclusive) def __del__(self): self.close()