Explorar o código

if ensure_dir() fails, give more informative error message, fixes #5952

previously, it just said PermissionDenied with giving the filename/path.
Thomas Waldmann %!s(int64=3) %!d(string=hai) anos
pai
achega
79964d1a2b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/borg/helpers/fs.py

+ 1 - 1
src/borg/helpers/fs.py

@@ -36,7 +36,7 @@ def ensure_dir(path, mode=stat.S_IRWXU, pretty_deadly=True):
         os.makedirs(path, mode=mode, exist_ok=True)
     except OSError as e:
         if pretty_deadly:
-            raise Error(e.args[1])
+            raise Error(str(e))
         else:
             raise