Message142293
I think the functions should:
- accept both str and bytes for keys and values; when it's an str, encoding it using the FS encoding
- return str for attribute names, using the FS encoding
- return bytes for attribute values, although returning str might be reasonable as well
I also get the following test failures:
======================================================================
FAIL: test_fds (test.test_os.ExtendedAttributeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/test/test_os.py", line 1579, in test_fds
self._check_xattrs(getxattr, setxattr, removexattr, listxattr)
File "/home/antoine/cpython/default/Lib/test/test_os.py", line 1542, in _check_xattrs
setxattr(fn, b"user.test", b"bye", os.XATTR_CREATE)
AssertionError: OSError not raised
======================================================================
FAIL: test_lpath (test.test_os.ExtendedAttributeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/test/test_os.py", line 1564, in test_lpath
os.llistxattr)
File "/home/antoine/cpython/default/Lib/test/test_os.py", line 1542, in _check_xattrs
setxattr(fn, b"user.test", b"bye", os.XATTR_CREATE)
AssertionError: OSError not raised
======================================================================
FAIL: test_simple (test.test_os.ExtendedAttributeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/cpython/default/Lib/test/test_os.py", line 1560, in test_simple
os.listxattr)
File "/home/antoine/cpython/default/Lib/test/test_os.py", line 1542, in _check_xattrs
setxattr(fn, b"user.test", b"bye", os.XATTR_CREATE)
AssertionError: OSError not raised |
|
Date |
User |
Action |
Args |
2011-08-17 22:04:21 | pitrou | set | recipients:
+ pitrou, benjamin.peterson |
2011-08-17 22:04:21 | pitrou | set | messageid: <1313618661.89.0.946127810392.issue12720@psf.upfronthosting.co.za> |
2011-08-17 22:04:21 | pitrou | link | issue12720 messages |
2011-08-17 22:04:21 | pitrou | create | |
|