Commit 1a8aa424 authored by owsla's avatar owsla

Whoops. There is no such thing as a 'ListError' in python -- was confused

by a traceback message.


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@893 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 9b796f17
...@@ -57,7 +57,7 @@ class ExtendedAttributes: ...@@ -57,7 +57,7 @@ class ExtendedAttributes:
def read_from_rp(self, rp): def read_from_rp(self, rp):
"""Set the extended attributes from an rpath""" """Set the extended attributes from an rpath"""
try: attr_list = rp.conn.xattr.listxattr(rp.path) try: attr_list = rp.conn.xattr.listxattr(rp.path)
except (IOError, ListError), exc: except IOError, exc:
if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM: if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM:
return # if not supported, consider empty return # if not supported, consider empty
if exc[0] == errno.EACCES or exc[0] == errno.ENOENT: if exc[0] == errno.EACCES or exc[0] == errno.ENOENT:
...@@ -93,7 +93,7 @@ class ExtendedAttributes: ...@@ -93,7 +93,7 @@ class ExtendedAttributes:
% (name, repr(rp.path)), 7) % (name, repr(rp.path)), 7)
continue continue
else: raise else: raise
except (IOError, ListError), exc: except IOError, exc:
if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM: if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM:
return # if not supported, consider empty return # if not supported, consider empty
if exc[0] == errno.ENOENT: # path is bad if exc[0] == errno.ENOENT: # path is bad
...@@ -108,7 +108,7 @@ class ExtendedAttributes: ...@@ -108,7 +108,7 @@ class ExtendedAttributes:
for (name, value) in self.attr_dict.iteritems(): for (name, value) in self.attr_dict.iteritems():
try: try:
rp.conn.xattr.setxattr(rp.path, name, value) rp.conn.xattr.setxattr(rp.path, name, value)
except (IOError, ListError), exc: except IOError, exc:
# Mac and Linux attributes have different namespaces, so # Mac and Linux attributes have different namespaces, so
# fail gracefully if can't call setxattr # fail gracefully if can't call setxattr
if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EACCES \ if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EACCES \
...@@ -381,7 +381,7 @@ def get_acl_lists_from_rp(rp): ...@@ -381,7 +381,7 @@ def get_acl_lists_from_rp(rp):
"""Returns (acl_list, def_acl_list) from an rpath. Call locally""" """Returns (acl_list, def_acl_list) from an rpath. Call locally"""
assert rp.conn is Globals.local_connection assert rp.conn is Globals.local_connection
try: acl = posix1e.ACL(file=rp.path) try: acl = posix1e.ACL(file=rp.path)
except (IOError, ListError), exc: except IOError, exc:
if exc[0] == errno.EOPNOTSUPP: acl = None if exc[0] == errno.EOPNOTSUPP: acl = None
if exc[0] == errno.ENOENT: if exc[0] == errno.ENOENT:
log.Log("Warning: unable to read ACL from %s: %s" log.Log("Warning: unable to read ACL from %s: %s"
...@@ -390,7 +390,7 @@ def get_acl_lists_from_rp(rp): ...@@ -390,7 +390,7 @@ def get_acl_lists_from_rp(rp):
else: raise else: raise
if rp.isdir(): if rp.isdir():
try: def_acl = posix1e.ACL(filedef=rp.path) try: def_acl = posix1e.ACL(filedef=rp.path)
except (IOError, ListError), exc: except IOError, exc:
if exc[0] == errno.EOPNOTSUPP: def_acl = None if exc[0] == errno.EOPNOTSUPP: def_acl = None
if exc[0] == errno.ENOENT: if exc[0] == errno.ENOENT:
log.Log("Warning: unable to read default ACL from %s: %s" log.Log("Warning: unable to read default ACL from %s: %s"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment