Преглед на файлове

xattr: fix dummy base getxattr, must raise for any given name

Thomas Waldmann преди 7 години
родител
ревизия
34a51eb958
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      src/borg/platform/base.py

+ 3 - 1
src/borg/platform/base.py

@@ -44,7 +44,9 @@ def getxattr(path, name, *, follow_symlinks=True):
     *follow_symlinks* indicates whether symlinks should be followed
     and only applies when *path* is not an open file descriptor.
     """
-    return b''
+    # as this base dummy implementation returns [] from listxattr,
+    # it must raise here for any given name:
+    raise OSError(ENOATTR, os.strerror(ENOATTR), path)
 
 
 def setxattr(path, name, value, *, follow_symlinks=True):