Antoine Pitrou <pit...@free.fr> added the comment: 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 ---------- nosy: +pitrou _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12720> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com