SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
pyxattr on OSs without xattr support
Author Message
Post pyxattr on OSs without xattr support 
Hello,

On Alpha, when I tried rdiff-backup when the .deb was built with support
for pyxattr, I got:

IOError: [Errno 78] Function not implemented

on Alpha.

So I have been making sure that rdiff-backup on Debian does not use
xattr/ACL support. However, those are nice features to have.

Would it be possible to have a runtime check to make sure the host OS
supports xattrs and ACLs prior to trying to use them?

Specifically, I look at this code in fs_abilities.py:

try:
xattr.listxattr(rp.path)
if write:
xattr.setxattr(rp.path, "user.test", "test val")
assert xattr.getxattr(rp.path, "user.test") == "
test val"
except IOError, exc:
if exc[0] == errno.EOPNOTSUPP:
log.Log("Extended attributes not supported by "
"filesystem at %s" % (rp.path,),
4)
self.eas = 0
else: raise

I think that the else should not do a raise but should set eas to 0.
Or, to put it another way, exc[0] should not be tested.


-- John

Post pyxattr on OSs without xattr support 
John Goerzen <jgoerzen < at > complete.org>
wrote the following on Fri, 4 Jun 2004 11:57:23 -0500

Specifically, I look at this code in fs_abilities.py:

try:
xattr.listxattr(rp.path)
if write:
xattr.setxattr(rp.path, "user.test", "test val")
assert xattr.getxattr(rp.path, "user.test") == "test val"
except IOError, exc:
if exc[0] == errno.EOPNOTSUPP:
log.Log("Extended attributes not supported by "
"filesystem at %s" % (rp.path,), 4)
self.eas = 0
else: raise

I think that the else should not do a raise but should set eas to 0.
Or, to put it another way, exc[0] should not be tested.

I guess I was trying to be precise by trying to check for certain
errors in particular, but I can't see the harm in doing what you say.

I've also removed the similar exc[0] checks when trying to detect
ownership changing, hardlinks, and extended attributes. Let me know
if you think this could cause any problems.


--
Ben Escoto

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB