Public bug reported:

xattr seems to read attributes from symlinks, but always set them on the
underlying file. Here's an example by way of a shell session:

$ cd /tmp
$ touch target
$ ln -s target source

$ python -i
>>> import xattr
>>> symlink = xattr.xattr('source', options=xattr.XATTR_NOFOLLOW)
>>> underlying_file = xattr.xattr('target')
>>> symlink['user.test_xattr'] = '1'

# now we should have an attribute on the symlink itself, and nothing on
the underlying file. But the opposite is true:

>>> symlink['user.test_xattr']
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)

/usr/lib/python2.7/dist-packages/xattr/__init__.pyc in __getitem__(self, item)
    131             return self.get(item)
    132         except IOError:
--> 133             raise KeyError(item)
    134 
    135     def iterkeys(self):

KeyError: 'user.test_xattr'

>>> underlying_file['user.test_xattr']
'1'

** Affects: python-xattr (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/919874

Title:
  cannot set attributes on symlink

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-xattr/+bug/919874/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to