Hello community,

here is the log from the commit of package python3-xattr for openSUSE:Factory 
checked in at 2016-11-16 13:33:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-xattr (Old)
 and      /work/SRC/openSUSE:Factory/.python3-xattr.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-xattr"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-xattr/python3-xattr.changes      
2016-11-09 11:39:27.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-xattr.new/python3-xattr.changes 
2016-11-16 13:33:56.000000000 +0100
@@ -1,0 +2,15 @@
+Sun Nov  6 20:33:42 UTC 2016 - a...@gmx.de
+
+- specfile:
+  * fix README.txt-> README.rst
+  * added CHANGES.txt and TODO.txt file
+  * use sitearch instead of sitelib
+
+- update to version 0.9.1:
+  * Allow (Python 2) long for fd
+  * Fix Python 3 bytes handling in xattr.tool
+  * Use cffi 1.X features to build native module for faster import
+  * NOTE: Version 0.9.0 is the same, was momentarily uploaded with
+    incomplete CHANGES.txt
+
+-------------------------------------------------------------------

Old:
----
  xattr-0.8.0.tar.gz

New:
----
  xattr-0.9.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-xattr.spec ++++++
--- /var/tmp/diff_new_pack.KUDTyg/_old  2016-11-16 13:33:57.000000000 +0100
+++ /var/tmp/diff_new_pack.KUDTyg/_new  2016-11-16 13:33:57.000000000 +0100
@@ -16,7 +16,7 @@
 
 
 Name:           python3-xattr
-Version:        0.8.0
+Version:        0.9.1
 Release:        0
 License:        MIT
 Summary:        Python wrapper for extended filesystem attributes
@@ -61,9 +61,9 @@
 
 %files
 %defattr(-,root,root,-)
-%doc README.txt LICENSE.txt
+%doc README.rst LICENSE.txt CHANGES.txt TODO.txt
 %{_bindir}/xattr-%{py_ver}
-%{python3_sitelib}/*
+%{python3_sitearch}/*
 %if 0%{?suse_version} && 0%{?suse_version} > 1310
 %{_bindir}/xattr
 %ghost %_sysconfdir/alternatives/xattr

++++++ xattr-0.8.0.tar.gz -> xattr-0.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/CHANGES.txt new/xattr-0.9.1/CHANGES.txt
--- old/xattr-0.8.0/CHANGES.txt 2016-02-28 20:11:18.000000000 +0100
+++ new/xattr-0.9.1/CHANGES.txt 2016-10-23 10:12:31.000000000 +0200
@@ -1,3 +1,14 @@
+Version 0.9.1 released 2016-10-23
+
+* Allow (Python 2) long for fd
+  https://github.com/xattr/xattr/pull/51
+* Fix Python 3 bytes handling in xattr.tool
+  https://github.com/xattr/xattr/pull/50
+* Use cffi 1.X features to build native module for faster import
+  https://github.com/xattr/xattr/pull/47
+* NOTE: Version 0.9.0 is the same, was momentarily uploaded with
+  incomplete CHANGES.txt
+
 Version 0.8.0 released 2016-02-28
 
 * Use os.fsencode where available to better handle filesystem quirks related
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/PKG-INFO new/xattr-0.9.1/PKG-INFO
--- old/xattr-0.8.0/PKG-INFO    2016-02-28 20:20:52.000000000 +0100
+++ new/xattr-0.9.1/PKG-INFO    2016-10-23 10:13:10.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: xattr
-Version: 0.8.0
+Version: 0.9.1
 Summary: Python wrapper for extended filesystem attributes
 Home-page: http://github.com/xattr/xattr
 Author: Bob Ippolito
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/README.rst new/xattr-0.9.1/README.rst
--- old/xattr-0.8.0/README.rst  1970-01-01 01:00:00.000000000 +0100
+++ new/xattr-0.9.1/README.rst  2016-10-23 07:54:38.000000000 +0200
@@ -0,0 +1,14 @@
+xattr
+-----
+
+.. image:: https://travis-ci.org/xattr/xattr.svg?branch=master
+    :target: https://travis-ci.org/xattr/xattr
+
+xattr is a Python wrapper for extended filesystem attributes.
+
+Extended attributes extend the basic attributes of files and directories
+in the file system.  They are stored as name:data pairs associated with
+file system objects (files, directories, symlinks, etc).
+
+Extended attributes are currently only available on Darwin 8.0+ (Mac OS X 10.4)
+and Linux 2.6+. Experimental support is included for Solaris and FreeBSD.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/README.txt new/xattr-0.9.1/README.txt
--- old/xattr-0.8.0/README.txt  2015-04-23 22:15:16.000000000 +0200
+++ new/xattr-0.9.1/README.txt  1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-xattr is a Python wrapper for extended filesystem attributes.
-
-Extended attributes extend the basic attributes of files and directories
-in the file system.  They are stored as name:data pairs associated with
-file system objects (files, directories, symlinks, etc).
-
-Extended attributes are currently only available on Darwin 8.0+ (Mac OS X 10.4)
-and Linux 2.6+. Experimental support is included for Solaris and FreeBSD.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/requirements.txt 
new/xattr-0.9.1/requirements.txt
--- old/xattr-0.8.0/requirements.txt    2015-04-23 22:15:16.000000000 +0200
+++ new/xattr-0.9.1/requirements.txt    2016-10-23 08:36:39.000000000 +0200
@@ -1 +1 @@
-cffi>=0.4
+cffi>=1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/setup.py new/xattr-0.9.1/setup.py
--- old/xattr-0.8.0/setup.py    2016-02-28 19:57:22.000000000 +0100
+++ new/xattr-0.9.1/setup.py    2016-10-23 10:11:46.000000000 +0200
@@ -4,19 +4,8 @@
 import sys
 
 from setuptools import setup
-from distutils.command.build import build
 
-class cffi_build(build):
-    """This is a shameful hack to ensure that cffi is present when
-    we specify ext_modules. We can't do this eagerly because
-    setup_requires hasn't run yet.
-    """
-    def finalize_options(self):
-        from xattr.lib import ffi
-        self.distribution.ext_modules = [ffi.verifier.get_extension()]
-        build.finalize_options(self)
-
-VERSION = '0.8.0'
+VERSION = '0.9.1'
 DESCRIPTION = "Python wrapper for extended filesystem attributes"
 LONG_DESCRIPTION = """
 Extended attributes extend the basic attributes of files and directories
@@ -60,9 +49,9 @@
             "xattr = xattr.tool:main",
         ],
     },
-    install_requires=["cffi>=0.4"],
-    setup_requires=["cffi>=0.4"],
+    install_requires=["cffi>=1.0.0"],
+    setup_requires=["cffi>=1.0.0"],
+    cffi_modules=["xattr/lib_build.py:ffi"],
     test_suite="xattr.tests.all_tests_suite",
     zip_safe=False,
-    cmdclass={'build': cffi_build},
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr/__init__.py 
new/xattr-0.9.1/xattr/__init__.py
--- old/xattr-0.8.0/xattr/__init__.py   2016-02-28 19:57:31.000000000 +0100
+++ new/xattr-0.9.1/xattr/__init__.py   2016-10-23 10:11:49.000000000 +0200
@@ -7,8 +7,9 @@
 that exposes these extended attributes.
 """
 
-__version__ = '0.8.0'
+__version__ = '0.9.1'
 
+from .compat import integer_types
 from .lib import (XATTR_NOFOLLOW, XATTR_CREATE, XATTR_REPLACE,
     XATTR_NOSECURITY, XATTR_MAXNAMELEN, XATTR_FINDERINFO_NAME,
     XATTR_RESOURCEFORK_NAME, _getxattr, _fgetxattr, _setxattr, _fsetxattr,
@@ -46,14 +47,14 @@
             self.value = obj
 
     def __repr__(self):
-        if isinstance(self.value, int):
+        if isinstance(self.value, integer_types):
             flavor = "fd"
         else:
             flavor = "file"
         return "<%s %s=%r>" % (type(self).__name__, flavor, self.value)
 
     def _call(self, name_func, fd_func, *args):
-        if isinstance(self.value, int):
+        if isinstance(self.value, integer_types):
             return fd_func(self.value, *args)
         else:
             return name_func(self.value, *args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr/compat.py 
new/xattr-0.9.1/xattr/compat.py
--- old/xattr-0.8.0/xattr/compat.py     1970-01-01 01:00:00.000000000 +0100
+++ new/xattr-0.9.1/xattr/compat.py     2016-10-23 08:21:08.000000000 +0200
@@ -0,0 +1,11 @@
+"""Python 3 compatibility shims
+"""
+import sys
+if sys.version_info[0] < 3:
+    integer_types = (int, long)
+    text_type = unicode
+    binary_type = str
+else:
+    integer_types = (int,)
+    text_type = str
+    binary_type = bytes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr/lib.py new/xattr-0.9.1/xattr/lib.py
--- old/xattr-0.8.0/xattr/lib.py        2016-02-28 20:08:11.000000000 +0100
+++ new/xattr-0.9.1/xattr/lib.py        2016-10-23 08:33:47.000000000 +0200
@@ -1,599 +1,11 @@
 import os
 import sys
 
-import cffi
-
-ffi = cffi.FFI()
-ffi.cdef("""
-#define XATTR_XATTR_NOFOLLOW ...
-#define XATTR_XATTR_CREATE ...
-#define XATTR_XATTR_REPLACE ...
-#define XATTR_XATTR_NOSECURITY ...
-#define XATTR_MAXNAMELEN ...
-
-ssize_t xattr_getxattr(const char *, const char *, void *, ssize_t, uint32_t, 
int);
-ssize_t xattr_fgetxattr(int, const char *, void *, ssize_t, uint32_t, int);
-
-ssize_t xattr_setxattr(const char *, const char *, void *, ssize_t, uint32_t, 
int);
-ssize_t xattr_fsetxattr(int, const char *, void *, ssize_t, uint32_t, int);
-
-ssize_t xattr_removexattr(const char *, const char *, int);
-ssize_t xattr_fremovexattr(int, const char *, int);
-
-ssize_t xattr_listxattr(const char *, char *, size_t, int);
-ssize_t xattr_flistxattr(int, char *, size_t, int);
-
-""")
-
-lib = ffi.verify("""
-#include "Python.h"
-#ifdef __FreeBSD__
-#include <sys/extattr.h>
-#elif defined(__SUN__) || defined(__sun__) || defined(__sun)
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <alloca.h>
-#else
-#include <sys/xattr.h>
-#endif
-
-#ifdef __FreeBSD__
-
-/* FreeBSD compatibility API */
-#define XATTR_XATTR_NOFOLLOW 0x0001
-#define XATTR_XATTR_CREATE 0x0002
-#define XATTR_XATTR_REPLACE 0x0004
-#define XATTR_XATTR_NOSECURITY 0x0008
-
-#define XATTR_CREATE 0x1
-#define XATTR_REPLACE 0x2
-
-/* Converts a freebsd format attribute list into a NULL terminated list.
- * While the man page on extattr_list_file says it is NULL terminated,
- * it is actually the first byte that is the length of the
- * following attribute.
- */
-static void convert_bsd_list(char *namebuf, size_t size)
-{
-    size_t offset = 0;
-    while(offset < size) {
-        int length = (int) namebuf[offset];
-        memmove(namebuf+offset, namebuf+offset+1, length);
-        namebuf[offset+length] = '\\0';
-        offset += length+1;
-    }
-}
-
-static ssize_t xattr_getxattr(const char *path, const char *name,
-                              void *value, ssize_t size, u_int32_t position,
-                              int options)
-{
-    if (position != 0 ||
-        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return extattr_get_link(path, EXTATTR_NAMESPACE_USER,
-                                name, value, size);
-    }
-    else {
-        return extattr_get_file(path, EXTATTR_NAMESPACE_USER,
-                                name, value, size);
-    }
-}
-
-static ssize_t xattr_setxattr(const char *path, const char *name,
-                              void *value, ssize_t size, u_int32_t position,
-                              int options)
-{
-    int rv = 0;
-    int nofollow;
-
-    if (position != 0) {
-        return -1;
-    }
-
-    nofollow = options & XATTR_XATTR_NOFOLLOW;
-    options &= ~XATTR_XATTR_NOFOLLOW;
-
-    if (options == XATTR_XATTR_CREATE ||
-        options == XATTR_XATTR_REPLACE) {
-
-        /* meh. FreeBSD doesn't really have this in its
-         * API... Oh well.
-         */
-    }
-    else if (options != 0) {
-        return -1;
-    }
-
-    if (nofollow) {
-        rv = extattr_set_link(path, EXTATTR_NAMESPACE_USER,
-                                name, value, size);
-    }
-    else {
-        rv = extattr_set_file(path, EXTATTR_NAMESPACE_USER,
-                                name, value, size);
-    }
-
-    /* freebsd returns the written length on success, not zero. */
-    if (rv >= 0) {
-        return 0;
-    }
-    else {
-        return rv;
-    }
-}
-
-static ssize_t xattr_removexattr(const char *path, const char *name,
-                                 int options)
-{
-    if (!(options == 0 ||
-          options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return extattr_delete_link(path, EXTATTR_NAMESPACE_USER, name);
-    }
-    else {
-        return extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name);
-    }
-}
-
-
-static ssize_t xattr_listxattr(const char *path, char *namebuf,
-                               size_t size, int options)
-{
-    ssize_t rv = 0;
-    if (!(options == 0 ||
-          options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        rv = extattr_list_link(path, EXTATTR_NAMESPACE_USER, namebuf, size);
-    }
-    else {
-        rv = extattr_list_file(path, EXTATTR_NAMESPACE_USER, namebuf, size);
-    }
-
-    if (rv > 0 && namebuf) {
-        convert_bsd_list(namebuf, rv);
-    }
-
-    return rv;
-}
-
-static ssize_t xattr_fgetxattr(int fd, const char *name, void *value,
-                               ssize_t size, u_int32_t position, int options)
-{
-    if (position != 0 ||
-        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return -1;
-    }
-    else {
-        return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size);
-    }
-}
-
-static ssize_t xattr_fsetxattr(int fd, const char *name, void *value,
-                               ssize_t size, u_int32_t position, int options)
-{
-    int rv = 0;
-    int nofollow;
-
-    if (position != 0) {
-        return -1;
-    }
-
-    nofollow = options & XATTR_XATTR_NOFOLLOW;
-    options &= ~XATTR_XATTR_NOFOLLOW;
-
-    if (options == XATTR_XATTR_CREATE ||
-        options == XATTR_XATTR_REPLACE) {
-        /* freebsd noop */
-    }
-    else if (options != 0) {
-        return -1;
-    }
-
-    if (nofollow) {
-        return -1;
-    }
-    else {
-        rv = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER,
-                            name, value, size);
-    }
-
-    /* freebsd returns the written length on success, not zero. */
-    if (rv >= 0) {
-        return 0;
-    }
-    else {
-        return rv;
-    }
-}
-
-static ssize_t xattr_fremovexattr(int fd, const char *name, int options)
-{
-
-    if (!(options == 0 ||
-          options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return -1;
-    }
-    else {
-        return extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name);
-    }
-}
-
-
-static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int 
options)
-{
-    ssize_t rv = 0;
-
-    if (!(options == 0 ||
-          options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return -1;
-    }
-    else {
-        rv = extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, namebuf, size);
-    }
-
-    if (rv > 0 && namebuf) {
-        convert_bsd_list(namebuf, rv);
-    }
-
-    return rv;
-}
-
-#elif defined(__SUN__) || defined(__sun__) || defined(__sun)
-
-/* Solaris 9 and later compatibility API */
-#define XATTR_XATTR_NOFOLLOW 0x0001
-#define XATTR_XATTR_CREATE 0x0002
-#define XATTR_XATTR_REPLACE 0x0004
-#define XATTR_XATTR_NOSECURITY 0x0008
-
-#define XATTR_CREATE 0x1
-#define XATTR_REPLACE 0x2
-
-#ifndef u_int32_t
-#define u_int32_t uint32_t
-#endif
-
-static ssize_t xattr_fgetxattr(int fd, const char *name, void *value,
-                               ssize_t size, u_int32_t position, int options)
-{
-    int xfd;
-    ssize_t bytes;
-    struct stat statbuf;
-
-    /* XXX should check that name does not have / characters in it */
-    xfd = openat(fd, name, O_RDONLY | O_XATTR);
-    if (xfd == -1) {
-    return -1;
-    }
-    if (lseek(xfd, position, SEEK_SET) == -1) {
-    close(xfd);
-    return -1;
-    }
-    if (value == NULL) {
-        if (fstat(xfd, &statbuf) == -1) {
-        close(xfd);
-        return -1;
-        }
-    close(xfd);
-    return statbuf.st_size;
-    }
-    /* XXX should keep reading until the buffer is exhausted or EOF */
-    bytes = read(xfd, value, size);
-    close(xfd);
-    return bytes;
-}
-
-static ssize_t xattr_getxattr(const char *path, const char *name,
-                              void *value, ssize_t size, u_int32_t position,
-                              int options)
-{
-    int fd;
-    ssize_t bytes;
-
-    if (position != 0 ||
-        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-
-    fd = open(path,
-          O_RDONLY |
-          ((options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0));
-    if (fd == -1) {
-    return -1;
-    }
-    bytes = xattr_fgetxattr(fd, name, value, size, position, options);
-    close(fd);
-    return bytes;
-}
-
-static ssize_t xattr_fsetxattr(int fd, const char *name, void *value,
-                               ssize_t size, u_int32_t position, int options)
-{
-    int xfd;
-    ssize_t bytes = 0;
-
-    /* XXX should check that name does not have / characters in it */
-    xfd = openat(fd, name, O_XATTR | O_TRUNC |
-         ((options & XATTR_XATTR_CREATE) ? O_EXCL : 0) |
-         ((options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0) |
-         ((options & XATTR_XATTR_REPLACE) ? O_RDWR : O_WRONLY|O_CREAT),
-         0644);
-    if (xfd == -1) {
-    return -1;
-    }
-    while (size > 0) {
-    bytes = write(xfd, value, size);
-    if (bytes == -1) {
-        close(xfd);
-        return -1;
-    }
-    size -= bytes;
-    value += bytes;
-    }
-    close(xfd);
-    return 0;
-}
-
-static ssize_t xattr_setxattr(const char *path, const char *name,
-                              void *value, ssize_t size, u_int32_t position,
-                              int options)
-{
-    int fd;
-    ssize_t bytes;
-
-    if (position != 0) {
-        return -1;
-    }
-
-    fd = open(path,
-          O_RDONLY | (options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0);
-    if (fd == -1) {
-    return -1;
-    }
-    bytes = xattr_fsetxattr(fd, name, value, size, position, options);
-    close(fd);
-    return bytes;
-}
-
-static ssize_t xattr_fremovexattr(int fd, const char *name, int options)
-{
-  int xfd, status;
-    /* XXX should check that name does not have / characters in it */
-    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return -1;
-    }
-    xfd = openat(fd, ".", O_XATTR, 0644);
-    if (xfd == -1) {
-    return -1;
-    }
-    status = unlinkat(xfd, name, 0);
-    close(xfd);
-    return status;
-}
-
-static ssize_t xattr_removexattr(const char *path, const char *name,
-                                 int options)
-{
-    int fd;
-    ssize_t status;
-
-    fd = open(path,
-          O_RDONLY | ((options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0));
-    if (fd == -1) {
-    return -1;
-    }
-    status =  xattr_fremovexattr(fd, name, options);
-    close(fd);
-    return status;
-}
-
-static ssize_t xattr_xflistxattr(int xfd, char *namebuf, size_t size, int 
options)
-{
-    int esize;
-    DIR *dirp;
-    struct dirent *entry;
-    ssize_t nsize = 0;
-
-    dirp = fdopendir(xfd);
-    if (dirp == NULL) {
-        return (-1);
-    }
-    while (entry = readdir(dirp)) {
-        if (strcmp(entry->d_name, ".") == 0 ||
-                strcmp(entry->d_name, "..") == 0)
-            continue;
-        esize = strlen(entry->d_name);
-        if (nsize + esize + 1 <= size) {
-            snprintf((char *)(namebuf + nsize), esize + 1,
-                    entry->d_name);
-        }
-        nsize += esize + 1; /* +1 for \\0 */
-    }
-    closedir(dirp);
-    return nsize;
-}
-static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int 
options)
-{
-    int xfd;
-
-    xfd = openat(fd, ".", O_RDONLY | O_XATTR);
-    return xattr_xflistxattr(xfd, namebuf, size, options);
-}
-
-static ssize_t xattr_listxattr(const char *path, char *namebuf,
-                               size_t size, int options)
-{
-    int xfd;
-
-    xfd = attropen(path, ".", O_RDONLY);
-    return xattr_xflistxattr(xfd, namebuf, size, options);
-}
-
-#elif !defined(XATTR_NOFOLLOW)
-/* Linux compatibility API */
-#define XATTR_XATTR_NOFOLLOW 0x0001
-#define XATTR_XATTR_CREATE 0x0002
-#define XATTR_XATTR_REPLACE 0x0004
-#define XATTR_XATTR_NOSECURITY 0x0008
-static ssize_t xattr_getxattr(const char *path, const char *name, void *value, 
ssize_t size, u_int32_t position, int options) {
-    if (position != 0 || !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return lgetxattr(path, name, value, size);
-    } else {
-        return getxattr(path, name, value, size);
-    }
-}
-
-static ssize_t xattr_setxattr(const char *path, const char *name, void *value, 
ssize_t size, u_int32_t position, int options) {
-    int nofollow;
-    if (position != 0) {
-        return -1;
-    }
-    nofollow = options & XATTR_XATTR_NOFOLLOW;
-    options &= ~XATTR_XATTR_NOFOLLOW;
-    if (options == XATTR_XATTR_CREATE) {
-        options = XATTR_CREATE;
-    } else if (options == XATTR_XATTR_REPLACE) {
-        options = XATTR_REPLACE;
-    } else if (options != 0) {
-        return -1;
-    }
-    if (nofollow) {
-        return lsetxattr(path, name, value, size, options);
-    } else {
-        return setxattr(path, name, value, size, options);
-    }
-}
-
-static ssize_t xattr_removexattr(const char *path, const char *name, int 
options) {
-    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return lremovexattr(path, name);
-    } else {
-        return removexattr(path, name);
-    }
-}
-
-
-static ssize_t xattr_listxattr(const char *path, char *namebuf, size_t size, 
int options) {
-    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return llistxattr(path, namebuf, size);
-    } else {
-        return listxattr(path, namebuf, size);
-    }
-}
-
-static ssize_t xattr_fgetxattr(int fd, const char *name, void *value, ssize_t 
size, u_int32_t position, int options) {
-    if (position != 0 || !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return -1;
-    } else {
-        return fgetxattr(fd, name, value, size);
-    }
-}
-
-static ssize_t xattr_fsetxattr(int fd, const char *name, void *value, ssize_t 
size, u_int32_t position, int options) {
-    int nofollow;
-    if (position != 0) {
-        return -1;
-    }
-    nofollow = options & XATTR_XATTR_NOFOLLOW;
-    options &= ~XATTR_XATTR_NOFOLLOW;
-    if (options == XATTR_XATTR_CREATE) {
-        options = XATTR_CREATE;
-    } else if (options == XATTR_XATTR_REPLACE) {
-        options = XATTR_REPLACE;
-    } else if (options != 0) {
-        return -1;
-    }
-    if (nofollow) {
-        return -1;
-    } else {
-        return fsetxattr(fd, name, value, size, options);
-    }
-}
-
-static ssize_t xattr_fremovexattr(int fd, const char *name, int options) {
-    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return -1;
-    } else {
-        return fremovexattr(fd, name);
-    }
-}
-
-
-static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int 
options) {
-    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
-        return -1;
-    }
-    if (options & XATTR_XATTR_NOFOLLOW) {
-        return -1;
-    } else {
-        return flistxattr(fd, namebuf, size);
-    }
-}
-
-#else /* Mac OS X assumed */
-#define xattr_getxattr getxattr
-#define xattr_fgetxattr fgetxattr
-#define xattr_removexattr removexattr
-#define xattr_fremovexattr fremovexattr
-#define xattr_setxattr setxattr
-#define xattr_fsetxattr fsetxattr
-#define xattr_listxattr listxattr
-#define xattr_flistxattr flistxattr
-
-/* define these for use in python (see below) */
-#define XATTR_XATTR_NOFOLLOW   XATTR_NOFOLLOW
-#define XATTR_XATTR_CREATE     XATTR_CREATE
-#define XATTR_XATTR_REPLACE    XATTR_REPLACE
-#define XATTR_XATTR_NOSECURITY XATTR_NOSECURITY
-#endif
-
-#ifndef XATTR_MAXNAMELEN
-#define XATTR_MAXNAMELEN 127
-#endif
-""", ext_package='xattr')
+try:
+    from ._lib import lib, ffi
+except ImportError:
+    from .lib_build import ffi, C_SRC
+    lib = ffi.verify(C_SRC)
 
 XATTR_NOFOLLOW = lib.XATTR_XATTR_NOFOLLOW
 XATTR_CREATE = lib.XATTR_XATTR_CREATE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr/lib_build.py 
new/xattr-0.9.1/xattr/lib_build.py
--- old/xattr-0.8.0/xattr/lib_build.py  1970-01-01 01:00:00.000000000 +0100
+++ new/xattr-0.9.1/xattr/lib_build.py  2016-10-23 08:33:47.000000000 +0200
@@ -0,0 +1,602 @@
+import os
+import sys
+
+import cffi
+
+ffi = cffi.FFI()
+ffi.cdef("""
+#define XATTR_XATTR_NOFOLLOW ...
+#define XATTR_XATTR_CREATE ...
+#define XATTR_XATTR_REPLACE ...
+#define XATTR_XATTR_NOSECURITY ...
+#define XATTR_MAXNAMELEN ...
+
+ssize_t xattr_getxattr(const char *, const char *, void *, ssize_t, uint32_t, 
int);
+ssize_t xattr_fgetxattr(int, const char *, void *, ssize_t, uint32_t, int);
+
+ssize_t xattr_setxattr(const char *, const char *, void *, ssize_t, uint32_t, 
int);
+ssize_t xattr_fsetxattr(int, const char *, void *, ssize_t, uint32_t, int);
+
+ssize_t xattr_removexattr(const char *, const char *, int);
+ssize_t xattr_fremovexattr(int, const char *, int);
+
+ssize_t xattr_listxattr(const char *, char *, size_t, int);
+ssize_t xattr_flistxattr(int, char *, size_t, int);
+
+""")
+
+C_SRC = """
+#include "Python.h"
+#ifdef __FreeBSD__
+#include <sys/extattr.h>
+#elif defined(__SUN__) || defined(__sun__) || defined(__sun)
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <alloca.h>
+#else
+#include <sys/xattr.h>
+#endif
+
+#ifdef __FreeBSD__
+
+/* FreeBSD compatibility API */
+#define XATTR_XATTR_NOFOLLOW 0x0001
+#define XATTR_XATTR_CREATE 0x0002
+#define XATTR_XATTR_REPLACE 0x0004
+#define XATTR_XATTR_NOSECURITY 0x0008
+
+#define XATTR_CREATE 0x1
+#define XATTR_REPLACE 0x2
+
+/* Converts a freebsd format attribute list into a NULL terminated list.
+ * While the man page on extattr_list_file says it is NULL terminated,
+ * it is actually the first byte that is the length of the
+ * following attribute.
+ */
+static void convert_bsd_list(char *namebuf, size_t size)
+{
+    size_t offset = 0;
+    while(offset < size) {
+        int length = (int) namebuf[offset];
+        memmove(namebuf+offset, namebuf+offset+1, length);
+        namebuf[offset+length] = '\\0';
+        offset += length+1;
+    }
+}
+
+static ssize_t xattr_getxattr(const char *path, const char *name,
+                              void *value, ssize_t size, u_int32_t position,
+                              int options)
+{
+    if (position != 0 ||
+        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return extattr_get_link(path, EXTATTR_NAMESPACE_USER,
+                                name, value, size);
+    }
+    else {
+        return extattr_get_file(path, EXTATTR_NAMESPACE_USER,
+                                name, value, size);
+    }
+}
+
+static ssize_t xattr_setxattr(const char *path, const char *name,
+                              void *value, ssize_t size, u_int32_t position,
+                              int options)
+{
+    int rv = 0;
+    int nofollow;
+
+    if (position != 0) {
+        return -1;
+    }
+
+    nofollow = options & XATTR_XATTR_NOFOLLOW;
+    options &= ~XATTR_XATTR_NOFOLLOW;
+
+    if (options == XATTR_XATTR_CREATE ||
+        options == XATTR_XATTR_REPLACE) {
+
+        /* meh. FreeBSD doesn't really have this in its
+         * API... Oh well.
+         */
+    }
+    else if (options != 0) {
+        return -1;
+    }
+
+    if (nofollow) {
+        rv = extattr_set_link(path, EXTATTR_NAMESPACE_USER,
+                                name, value, size);
+    }
+    else {
+        rv = extattr_set_file(path, EXTATTR_NAMESPACE_USER,
+                                name, value, size);
+    }
+
+    /* freebsd returns the written length on success, not zero. */
+    if (rv >= 0) {
+        return 0;
+    }
+    else {
+        return rv;
+    }
+}
+
+static ssize_t xattr_removexattr(const char *path, const char *name,
+                                 int options)
+{
+    if (!(options == 0 ||
+          options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return extattr_delete_link(path, EXTATTR_NAMESPACE_USER, name);
+    }
+    else {
+        return extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name);
+    }
+}
+
+
+static ssize_t xattr_listxattr(const char *path, char *namebuf,
+                               size_t size, int options)
+{
+    ssize_t rv = 0;
+    if (!(options == 0 ||
+          options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        rv = extattr_list_link(path, EXTATTR_NAMESPACE_USER, namebuf, size);
+    }
+    else {
+        rv = extattr_list_file(path, EXTATTR_NAMESPACE_USER, namebuf, size);
+    }
+
+    if (rv > 0 && namebuf) {
+        convert_bsd_list(namebuf, rv);
+    }
+
+    return rv;
+}
+
+static ssize_t xattr_fgetxattr(int fd, const char *name, void *value,
+                               ssize_t size, u_int32_t position, int options)
+{
+    if (position != 0 ||
+        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return -1;
+    }
+    else {
+        return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size);
+    }
+}
+
+static ssize_t xattr_fsetxattr(int fd, const char *name, void *value,
+                               ssize_t size, u_int32_t position, int options)
+{
+    int rv = 0;
+    int nofollow;
+
+    if (position != 0) {
+        return -1;
+    }
+
+    nofollow = options & XATTR_XATTR_NOFOLLOW;
+    options &= ~XATTR_XATTR_NOFOLLOW;
+
+    if (options == XATTR_XATTR_CREATE ||
+        options == XATTR_XATTR_REPLACE) {
+        /* freebsd noop */
+    }
+    else if (options != 0) {
+        return -1;
+    }
+
+    if (nofollow) {
+        return -1;
+    }
+    else {
+        rv = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER,
+                            name, value, size);
+    }
+
+    /* freebsd returns the written length on success, not zero. */
+    if (rv >= 0) {
+        return 0;
+    }
+    else {
+        return rv;
+    }
+}
+
+static ssize_t xattr_fremovexattr(int fd, const char *name, int options)
+{
+
+    if (!(options == 0 ||
+          options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return -1;
+    }
+    else {
+        return extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name);
+    }
+}
+
+
+static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int 
options)
+{
+    ssize_t rv = 0;
+
+    if (!(options == 0 ||
+          options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return -1;
+    }
+    else {
+        rv = extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, namebuf, size);
+    }
+
+    if (rv > 0 && namebuf) {
+        convert_bsd_list(namebuf, rv);
+    }
+
+    return rv;
+}
+
+#elif defined(__SUN__) || defined(__sun__) || defined(__sun)
+
+/* Solaris 9 and later compatibility API */
+#define XATTR_XATTR_NOFOLLOW 0x0001
+#define XATTR_XATTR_CREATE 0x0002
+#define XATTR_XATTR_REPLACE 0x0004
+#define XATTR_XATTR_NOSECURITY 0x0008
+
+#define XATTR_CREATE 0x1
+#define XATTR_REPLACE 0x2
+
+#ifndef u_int32_t
+#define u_int32_t uint32_t
+#endif
+
+static ssize_t xattr_fgetxattr(int fd, const char *name, void *value,
+                               ssize_t size, u_int32_t position, int options)
+{
+    int xfd;
+    ssize_t bytes;
+    struct stat statbuf;
+
+    /* XXX should check that name does not have / characters in it */
+    xfd = openat(fd, name, O_RDONLY | O_XATTR);
+    if (xfd == -1) {
+    return -1;
+    }
+    if (lseek(xfd, position, SEEK_SET) == -1) {
+    close(xfd);
+    return -1;
+    }
+    if (value == NULL) {
+        if (fstat(xfd, &statbuf) == -1) {
+        close(xfd);
+        return -1;
+        }
+    close(xfd);
+    return statbuf.st_size;
+    }
+    /* XXX should keep reading until the buffer is exhausted or EOF */
+    bytes = read(xfd, value, size);
+    close(xfd);
+    return bytes;
+}
+
+static ssize_t xattr_getxattr(const char *path, const char *name,
+                              void *value, ssize_t size, u_int32_t position,
+                              int options)
+{
+    int fd;
+    ssize_t bytes;
+
+    if (position != 0 ||
+        !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+
+    fd = open(path,
+          O_RDONLY |
+          ((options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0));
+    if (fd == -1) {
+    return -1;
+    }
+    bytes = xattr_fgetxattr(fd, name, value, size, position, options);
+    close(fd);
+    return bytes;
+}
+
+static ssize_t xattr_fsetxattr(int fd, const char *name, void *value,
+                               ssize_t size, u_int32_t position, int options)
+{
+    int xfd;
+    ssize_t bytes = 0;
+
+    /* XXX should check that name does not have / characters in it */
+    xfd = openat(fd, name, O_XATTR | O_TRUNC |
+         ((options & XATTR_XATTR_CREATE) ? O_EXCL : 0) |
+         ((options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0) |
+         ((options & XATTR_XATTR_REPLACE) ? O_RDWR : O_WRONLY|O_CREAT),
+         0644);
+    if (xfd == -1) {
+    return -1;
+    }
+    while (size > 0) {
+    bytes = write(xfd, value, size);
+    if (bytes == -1) {
+        close(xfd);
+        return -1;
+    }
+    size -= bytes;
+    value += bytes;
+    }
+    close(xfd);
+    return 0;
+}
+
+static ssize_t xattr_setxattr(const char *path, const char *name,
+                              void *value, ssize_t size, u_int32_t position,
+                              int options)
+{
+    int fd;
+    ssize_t bytes;
+
+    if (position != 0) {
+        return -1;
+    }
+
+    fd = open(path,
+          O_RDONLY | (options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0);
+    if (fd == -1) {
+    return -1;
+    }
+    bytes = xattr_fsetxattr(fd, name, value, size, position, options);
+    close(fd);
+    return bytes;
+}
+
+static ssize_t xattr_fremovexattr(int fd, const char *name, int options)
+{
+  int xfd, status;
+    /* XXX should check that name does not have / characters in it */
+    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return -1;
+    }
+    xfd = openat(fd, ".", O_XATTR, 0644);
+    if (xfd == -1) {
+    return -1;
+    }
+    status = unlinkat(xfd, name, 0);
+    close(xfd);
+    return status;
+}
+
+static ssize_t xattr_removexattr(const char *path, const char *name,
+                                 int options)
+{
+    int fd;
+    ssize_t status;
+
+    fd = open(path,
+          O_RDONLY | ((options & XATTR_XATTR_NOFOLLOW) ? O_NOFOLLOW : 0));
+    if (fd == -1) {
+    return -1;
+    }
+    status =  xattr_fremovexattr(fd, name, options);
+    close(fd);
+    return status;
+}
+
+static ssize_t xattr_xflistxattr(int xfd, char *namebuf, size_t size, int 
options)
+{
+    int esize;
+    DIR *dirp;
+    struct dirent *entry;
+    ssize_t nsize = 0;
+
+    dirp = fdopendir(xfd);
+    if (dirp == NULL) {
+        return (-1);
+    }
+    while (entry = readdir(dirp)) {
+        if (strcmp(entry->d_name, ".") == 0 ||
+                strcmp(entry->d_name, "..") == 0)
+            continue;
+        esize = strlen(entry->d_name);
+        if (nsize + esize + 1 <= size) {
+            snprintf((char *)(namebuf + nsize), esize + 1,
+                    entry->d_name);
+        }
+        nsize += esize + 1; /* +1 for \\0 */
+    }
+    closedir(dirp);
+    return nsize;
+}
+static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int 
options)
+{
+    int xfd;
+
+    xfd = openat(fd, ".", O_RDONLY | O_XATTR);
+    return xattr_xflistxattr(xfd, namebuf, size, options);
+}
+
+static ssize_t xattr_listxattr(const char *path, char *namebuf,
+                               size_t size, int options)
+{
+    int xfd;
+
+    xfd = attropen(path, ".", O_RDONLY);
+    return xattr_xflistxattr(xfd, namebuf, size, options);
+}
+
+#elif !defined(XATTR_NOFOLLOW)
+/* Linux compatibility API */
+#define XATTR_XATTR_NOFOLLOW 0x0001
+#define XATTR_XATTR_CREATE 0x0002
+#define XATTR_XATTR_REPLACE 0x0004
+#define XATTR_XATTR_NOSECURITY 0x0008
+static ssize_t xattr_getxattr(const char *path, const char *name, void *value, 
ssize_t size, u_int32_t position, int options) {
+    if (position != 0 || !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return lgetxattr(path, name, value, size);
+    } else {
+        return getxattr(path, name, value, size);
+    }
+}
+
+static ssize_t xattr_setxattr(const char *path, const char *name, void *value, 
ssize_t size, u_int32_t position, int options) {
+    int nofollow;
+    if (position != 0) {
+        return -1;
+    }
+    nofollow = options & XATTR_XATTR_NOFOLLOW;
+    options &= ~XATTR_XATTR_NOFOLLOW;
+    if (options == XATTR_XATTR_CREATE) {
+        options = XATTR_CREATE;
+    } else if (options == XATTR_XATTR_REPLACE) {
+        options = XATTR_REPLACE;
+    } else if (options != 0) {
+        return -1;
+    }
+    if (nofollow) {
+        return lsetxattr(path, name, value, size, options);
+    } else {
+        return setxattr(path, name, value, size, options);
+    }
+}
+
+static ssize_t xattr_removexattr(const char *path, const char *name, int 
options) {
+    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return lremovexattr(path, name);
+    } else {
+        return removexattr(path, name);
+    }
+}
+
+
+static ssize_t xattr_listxattr(const char *path, char *namebuf, size_t size, 
int options) {
+    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return llistxattr(path, namebuf, size);
+    } else {
+        return listxattr(path, namebuf, size);
+    }
+}
+
+static ssize_t xattr_fgetxattr(int fd, const char *name, void *value, ssize_t 
size, u_int32_t position, int options) {
+    if (position != 0 || !(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return -1;
+    } else {
+        return fgetxattr(fd, name, value, size);
+    }
+}
+
+static ssize_t xattr_fsetxattr(int fd, const char *name, void *value, ssize_t 
size, u_int32_t position, int options) {
+    int nofollow;
+    if (position != 0) {
+        return -1;
+    }
+    nofollow = options & XATTR_XATTR_NOFOLLOW;
+    options &= ~XATTR_XATTR_NOFOLLOW;
+    if (options == XATTR_XATTR_CREATE) {
+        options = XATTR_CREATE;
+    } else if (options == XATTR_XATTR_REPLACE) {
+        options = XATTR_REPLACE;
+    } else if (options != 0) {
+        return -1;
+    }
+    if (nofollow) {
+        return -1;
+    } else {
+        return fsetxattr(fd, name, value, size, options);
+    }
+}
+
+static ssize_t xattr_fremovexattr(int fd, const char *name, int options) {
+    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return -1;
+    } else {
+        return fremovexattr(fd, name);
+    }
+}
+
+
+static ssize_t xattr_flistxattr(int fd, char *namebuf, size_t size, int 
options) {
+    if (!(options == 0 || options == XATTR_XATTR_NOFOLLOW)) {
+        return -1;
+    }
+    if (options & XATTR_XATTR_NOFOLLOW) {
+        return -1;
+    } else {
+        return flistxattr(fd, namebuf, size);
+    }
+}
+
+#else /* Mac OS X assumed */
+#define xattr_getxattr getxattr
+#define xattr_fgetxattr fgetxattr
+#define xattr_removexattr removexattr
+#define xattr_fremovexattr fremovexattr
+#define xattr_setxattr setxattr
+#define xattr_fsetxattr fsetxattr
+#define xattr_listxattr listxattr
+#define xattr_flistxattr flistxattr
+
+/* define these for use in python (see below) */
+#define XATTR_XATTR_NOFOLLOW   XATTR_NOFOLLOW
+#define XATTR_XATTR_CREATE     XATTR_CREATE
+#define XATTR_XATTR_REPLACE    XATTR_REPLACE
+#define XATTR_XATTR_NOSECURITY XATTR_NOSECURITY
+#endif
+
+#ifndef XATTR_MAXNAMELEN
+#define XATTR_MAXNAMELEN 127
+#endif
+"""
+
+ffi.set_source('_lib', C_SRC)
+
+if __name__ == '__main__':
+    ffi.compile()
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr/pyxattr_compat.py 
new/xattr-0.9.1/xattr/pyxattr_compat.py
--- old/xattr-0.8.0/xattr/pyxattr_compat.py     2016-02-28 20:08:11.000000000 
+0100
+++ new/xattr-0.9.1/xattr/pyxattr_compat.py     2016-10-23 08:18:41.000000000 
+0200
@@ -8,6 +8,7 @@
 
 import sys
 
+from .compat import (binary_type, integer_types, text_type)
 from .lib import (XATTR_NOFOLLOW, XATTR_CREATE, XATTR_REPLACE,
     XATTR_NOSECURITY, XATTR_MAXNAMELEN, XATTR_FINDERINFO_NAME,
     XATTR_RESOURCEFORK_NAME, _getxattr, _fgetxattr, _setxattr, _fsetxattr,
@@ -29,13 +30,13 @@
 _fsencoding = sys.getfilesystemencoding()
 
 def _call(item, name_func, fd_func, *args):
-    if isinstance(item, int):
+    if isinstance(item, integer_types):
         return fd_func(item, *args)
     elif hasattr(item, 'fileno'):
         return fd_func(item.fileno(), *args)
-    elif isinstance(item, str):
+    elif isinstance(item, binary_type):
         return name_func(item, *args)
-    elif isinstance(item, unicode):
+    elif isinstance(item, text_type):
         item = item.encode(_fsencoding)
         return name_func(item, *args)
     else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr/tests/test_xattr.py 
new/xattr-0.9.1/xattr/tests/test_xattr.py
--- old/xattr-0.8.0/xattr/tests/test_xattr.py   2016-02-28 19:57:09.000000000 
+0100
+++ new/xattr-0.9.1/xattr/tests/test_xattr.py   2016-10-23 08:28:13.000000000 
+0200
@@ -8,6 +8,11 @@
 
 
 class BaseTestXattr(object):
+    # TESTDIR for temporary files usually defaults to "/tmp",
+    # which may not have XATTR support (e.g. tmpfs);
+    # manual override here.
+    TESTDIR = None
+
     def test_attr(self):
         x = xattr.xattr(self.tempfile)
 
@@ -66,15 +71,17 @@
             self.assertEqual(str(e), msg)
 
     def test_symlink_attrs(self):
-        # Solaris doesn't support extended attributes on symlinks
-        if sys.platform == 'sunos5':
-            return
         symlinkPath = self.tempfilename + '.link'
         os.symlink(self.tempfilename, symlinkPath)
         try:
             symlink = xattr.xattr(symlinkPath, options=xattr.XATTR_NOFOLLOW)
             realfile = xattr.xattr(self.tempfilename)
-            symlink['user.islink'] = b'true'
+            try:
+                symlink['user.islink'] = b'true'
+            except IOError:
+                # Solaris, Linux don't support extended attributes on symlinks
+                raise unittest.SkipTest("XATTRs on symlink not allowed"
+                                        " on filesystem/platform")
             self.assertEqual(dict(realfile), {})
             self.assertEqual(symlink['user.islink'], b'true')
         finally:
@@ -83,7 +90,7 @@
 
 class TestFile(TestCase, BaseTestXattr):
     def setUp(self):
-        self.tempfile = NamedTemporaryFile()
+        self.tempfile = NamedTemporaryFile(dir=self.TESTDIR)
         self.tempfilename = self.tempfile.name
 
     def tearDown(self):
@@ -92,7 +99,7 @@
 
 class TestDir(TestCase, BaseTestXattr):
     def setUp(self):
-        self.tempfile = mkdtemp()
+        self.tempfile = mkdtemp(dir=self.TESTDIR)
         self.tempfilename = self.tempfile
 
     def tearDown(self):
@@ -107,7 +114,9 @@
 else:
     class TestFileWithSurrogates(TestFile):
         def setUp(self):
-            if sys.platform != 'linux':
+            if sys.platform not in ('linux', 'linux2'):
                 raise unittest.SkipTest('Files with invalid encoded names are 
only supported under linux')
-            self.tempfile = 
NamedTemporaryFile(prefix=b'invalid-\xe9'.decode('utf8','surrogateescape'))
+            if sys.version_info[0] < 3:
+                raise unittest.SkipTest('Test is only available on Python3') # 
surrogateescape not avail in py2
+            self.tempfile = 
NamedTemporaryFile(prefix=b'invalid-\xe9'.decode('utf8','surrogateescape'), 
dir=self.TESTDIR)
             self.tempfilename = self.tempfile.name
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr/tool.py 
new/xattr-0.9.1/xattr/tool.py
--- old/xattr-0.8.0/xattr/tool.py       2015-04-23 22:15:16.000000000 +0200
+++ new/xattr-0.9.1/xattr/tool.py       2016-10-23 08:28:13.000000000 +0200
@@ -3,7 +3,7 @@
 ##
 # Copyright (c) 2007 Apple Inc.
 #
-# This is the MIT license.  This software may also be distributed under the
+# This is the MIT license. This software may also be distributed under the
 # same terms as Python (the PSF license).
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -35,6 +35,10 @@
 import xattr
 
 
+class NullsInString(Exception):
+    """Nulls in string."""
+
+
 def usage(e=None):
     if e:
         print(e)
@@ -62,10 +66,6 @@
         sys.exit(0)
 
 
-class NullsInString(Exception):
-    """Nulls in string."""
-
-
 _FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or '.' for x in 
range(256)])
 
 
@@ -127,7 +127,7 @@
     if write:
         if not args:
             usage("No attr_value")
-        attr_value = args.pop(0)
+        attr_value = args.pop(0).encode('utf-8')
 
     if len(args) > 1:
         multiple_files = True
@@ -185,13 +185,14 @@
                         attr_value = decompress(attrs[attr_name])
                     except zlib.error:
                         attr_value = attrs[attr_name]
+                    attr_value = attr_value.decode('utf-8')
                 except KeyError:
                     onError("%sNo such xattr: %s" % (file_prefix, attr_name))
                     continue
 
                 if long_format:
                     try:
-                        if attr_value.find('\0') >= 0:
+                        if '\0' in attr_value:
                             raise NullsInString
                         print("".join((file_prefix, "%s: " % (attr_name,), 
attr_value)))
                     except (UnicodeDecodeError, NullsInString):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr.egg-info/PKG-INFO 
new/xattr-0.9.1/xattr.egg-info/PKG-INFO
--- old/xattr-0.8.0/xattr.egg-info/PKG-INFO     2016-02-28 20:20:51.000000000 
+0100
+++ new/xattr-0.9.1/xattr.egg-info/PKG-INFO     2016-10-23 10:13:05.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: xattr
-Version: 0.8.0
+Version: 0.9.1
 Summary: Python wrapper for extended filesystem attributes
 Home-page: http://github.com/xattr/xattr
 Author: Bob Ippolito
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr.egg-info/SOURCES.txt 
new/xattr-0.9.1/xattr.egg-info/SOURCES.txt
--- old/xattr-0.8.0/xattr.egg-info/SOURCES.txt  2016-02-28 20:20:52.000000000 
+0100
+++ new/xattr-0.9.1/xattr.egg-info/SOURCES.txt  2016-10-23 10:13:05.000000000 
+0200
@@ -2,12 +2,14 @@
 INSTALLING.txt
 LICENSE.txt
 MANIFEST.in
-README.txt
+README.rst
 TODO.txt
 requirements.txt
 setup.py
 xattr/__init__.py
+xattr/compat.py
 xattr/lib.py
+xattr/lib_build.py
 xattr/pyxattr_compat.py
 xattr/tool.py
 xattr.egg-info/PKG-INFO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr.egg-info/requires.txt 
new/xattr-0.9.1/xattr.egg-info/requires.txt
--- old/xattr-0.8.0/xattr.egg-info/requires.txt 2016-02-28 20:20:51.000000000 
+0100
+++ new/xattr-0.9.1/xattr.egg-info/requires.txt 2016-10-23 10:13:05.000000000 
+0200
@@ -1 +1 @@
-cffi>=0.4
+cffi>=1.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.8.0/xattr.egg-info/top_level.txt 
new/xattr-0.9.1/xattr.egg-info/top_level.txt
--- old/xattr-0.8.0/xattr.egg-info/top_level.txt        2016-02-28 
20:20:51.000000000 +0100
+++ new/xattr-0.9.1/xattr.egg-info/top_level.txt        2016-10-23 
10:13:05.000000000 +0200
@@ -1 +1,2 @@
+_lib
 xattr


Reply via email to