[Bug 919874] Re: cannot set attributes on symlink

Chuck Short chuck.short at canonical.com
Mon Oct 17 17:06:24 UTC 2016


This should be fixed in xattr, please reopen if not.

** Changed in: python-xattr (Ubuntu)
       Status: Triaged => Fix Released

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

Title:
  cannot set attributes on symlink

Status in python-xattr package in Ubuntu:
  Fix Released

Bug description:
  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'

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



More information about the Ubuntu-openstack-bugs mailing list