瀏覽代碼

ObjectNotFound: give ID as hex-string

Marian Beermann 9 年之前
父節點
當前提交
0ae48dafbb
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/borg/repository.py

+ 5 - 0
src/borg/repository.py

@@ -96,6 +96,11 @@ class Repository:
     class ObjectNotFound(ErrorWithTraceback):
         """Object with key {} not found in repository {}."""
 
+        def __init__(self, id, repo):
+            if isinstance(id, bytes):
+                id = bin_to_hex(id)
+            super().__init__(id, repo)
+
     def __init__(self, path, create=False, exclusive=False, lock_wait=None, lock=True, append_only=False):
         self.path = os.path.abspath(path)
         self._location = Location('file://%s' % self.path)