Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-xattr for openSUSE:Factory 
checked in at 2021-12-09 19:45:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-xattr (Old)
 and      /work/SRC/openSUSE:Factory/.python-xattr.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-xattr"

Thu Dec  9 19:45:00 2021 rev:22 rq:934513 version:0.9.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-xattr/python-xattr.changes        
2020-03-27 00:26:56.520306787 +0100
+++ /work/SRC/openSUSE:Factory/.python-xattr.new.2520/python-xattr.changes      
2021-12-09 19:45:01.513116386 +0100
@@ -1,0 +2,8 @@
+Mon Nov 29 11:01:47 UTC 2021 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 0.9.8:
+  * Update build to use Github Actions
+  * Various dump related fixes
+  * Fix classifiers list
+
+-------------------------------------------------------------------

Old:
----
  xattr-0.9.7.tar.gz

New:
----
  xattr-0.9.8.tar.gz

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

Other differences:
------------------
++++++ python-xattr.spec ++++++
--- /var/tmp/diff_new_pack.NnEERN/_old  2021-12-09 19:45:02.077116657 +0100
+++ /var/tmp/diff_new_pack.NnEERN/_new  2021-12-09 19:45:02.081116659 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-xattr
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-xattr
-Version:        0.9.7
+Version:        0.9.8
 Release:        0
 Summary:        Python wrapper for extended filesystem attributes
 License:        MIT
@@ -33,7 +33,7 @@
 Requires:       python-cffi >= 1.11
 Requires:       python-setuptools
 Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
 %ifpython2
 Provides:       pyxattr = %{version}
 Obsoletes:      pyxattr < %{version}

++++++ xattr-0.9.7.tar.gz -> xattr-0.9.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/CHANGES.txt new/xattr-0.9.8/CHANGES.txt
--- old/xattr-0.9.7/CHANGES.txt 2019-12-02 22:56:17.000000000 +0100
+++ new/xattr-0.9.8/CHANGES.txt 2021-11-20 16:28:33.000000000 +0100
@@ -1,3 +1,12 @@
+Version 0.9.8 released 2021-11-19
+
+* Update build to use Github Actions
+  https://github.com/xattr/xattr/pull/95
+* Various dump related fixes
+  https://github.com/xattr/xattr/pull/93
+* Fix classifiers list
+  https://github.com/xattr/xattr/pull/89
+
 Version 0.9.7 released 2019-12-02
 
 * Fix xattr().update() in Python 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/PKG-INFO new/xattr-0.9.8/PKG-INFO
--- old/xattr-0.9.7/PKG-INFO    2019-12-02 23:08:52.000000000 +0100
+++ new/xattr-0.9.8/PKG-INFO    2021-11-20 16:28:36.953554600 +0100
@@ -1,19 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: xattr
-Version: 0.9.7
+Version: 0.9.8
 Summary: Python wrapper for extended filesystem attributes
 Home-page: http://github.com/xattr/xattr
 Author: Bob Ippolito
 Author-email: b...@redivi.com
 License: MIT License
-Description: 
-        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.
-        
 Platform: MacOS X
 Platform: Linux
 Platform: FreeBSD
@@ -29,3 +21,14 @@
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 3
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
+License-File: LICENSE.txt
+
+
+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.9.7/pyproject.toml 
new/xattr-0.9.8/pyproject.toml
--- old/xattr-0.9.7/pyproject.toml      1970-01-01 01:00:00.000000000 +0100
+++ new/xattr-0.9.8/pyproject.toml      2021-11-20 16:28:33.000000000 +0100
@@ -0,0 +1,14 @@
+[tool.cibuildwheel]
+test-requires = "pytest"
+test-command = "pytest {project}/xattr/tests"
+
+[tool.cibuildwheel.linux]
+before-all = "yum install -y libffi-devel"
+
+[[tool.cibuildwheel.overrides]]
+select = "*-manylinux2_*"
+before-all = "apt-get -y install libffi-dev"
+
+[[tool.cibuildwheel.overrides]]
+select = "*-musllinux*"
+before-all = "apk add libffi-dev"
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/setup.py new/xattr-0.9.8/setup.py
--- old/xattr-0.9.7/setup.py    2019-12-02 22:56:17.000000000 +0100
+++ new/xattr-0.9.8/setup.py    2021-11-20 16:28:33.000000000 +0100
@@ -5,7 +5,7 @@
 
 from setuptools import setup
 
-VERSION = '0.9.7'
+VERSION = '0.9.8'
 DESCRIPTION = "Python wrapper for extended filesystem attributes"
 LONG_DESCRIPTION = """
 Extended attributes extend the basic attributes of files and directories
@@ -16,7 +16,7 @@
 and Linux 2.6+. Experimental support is included for Solaris and FreeBSD.
 """
 
-CLASSIFIERS = filter(bool, map(str.strip,
+CLASSIFIERS = list(filter(bool, map(str.strip,
 """
 Environment :: Console
 Intended Audience :: Developers
@@ -29,7 +29,7 @@
 Programming Language :: Python :: 2
 Programming Language :: Python :: 3
 Topic :: Software Development :: Libraries :: Python Modules
-""".splitlines()))
+""".splitlines())))
 
 setup(
     name="xattr",
@@ -49,8 +49,9 @@
             "xattr = xattr.tool:main",
         ],
     },
-    install_requires=["cffi>=1.0.0"],
-    setup_requires=["cffi>=1.0.0"],
+    # Keep this in sync with pyproject.toml
+    install_requires=["cffi>=1.0"],
+    setup_requires=["cffi>=1.0"],
     cffi_modules=["xattr/lib_build.py:ffi"],
     test_suite="xattr.tests.all_tests_suite",
     zip_safe=False,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/xattr/__init__.py 
new/xattr-0.9.8/xattr/__init__.py
--- old/xattr-0.9.7/xattr/__init__.py   2019-12-02 22:56:17.000000000 +0100
+++ new/xattr-0.9.8/xattr/__init__.py   2021-11-20 16:28:33.000000000 +0100
@@ -7,7 +7,7 @@
 that exposes these extended attributes.
 """
 
-__version__ = '0.9.7'
+__version__ = '0.9.8'
 
 from .compat import integer_types
 from .lib import (XATTR_NOFOLLOW, XATTR_CREATE, XATTR_REPLACE,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/xattr/pyxattr_compat.py 
new/xattr-0.9.8/xattr/pyxattr_compat.py
--- old/xattr-0.9.7/xattr/pyxattr_compat.py     2019-12-02 22:56:17.000000000 
+0100
+++ new/xattr-0.9.8/xattr/pyxattr_compat.py     2021-11-20 16:28:33.000000000 
+0100
@@ -20,10 +20,10 @@
     "removexattr", "remove", "listxattr", "list"
 ]
 
-NS_SECURITY = "security"
-NS_USER = "user"
-NS_SYSTEM = "system"
-NS_TRUSTED = "trusted"
+NS_SECURITY = b"security"
+NS_USER = b"user"
+NS_SYSTEM = b"system"
+NS_TRUSTED = b"trusted"
 
 _NO_NS = object()
 
@@ -47,7 +47,7 @@
         raise TypeError("namespace must not be None")
     if ns == _NO_NS:
         return item
-    return "%s.%s" % (ns, item)
+    return b'.'.join((ns, item))
 
 def getxattr(item, attribute, nofollow=False):
     options = nofollow and XATTR_NOFOLLOW or 0
@@ -59,7 +59,7 @@
 
 def get_all(item, nofollow=False, namespace=_NO_NS):
     if namespace is not None and namespace != _NO_NS:
-        namespace = '%s.' % namespace
+        namespace += b'.'
     l = listxattr(item, nofollow=nofollow)
     result = []
     for name in l:
@@ -101,7 +101,7 @@
 def list(item, nofollow=False, namespace=_NO_NS):
     if not namespace or namespace == _NO_NS:
         return listxattr(item, nofollow=nofollow)
-    namespace = "%s." % namespace
+    namespace += b'.'
     l = listxattr(item, nofollow=nofollow)
     result = []
     for name in l:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/xattr/tests/__init__.py 
new/xattr-0.9.8/xattr/tests/__init__.py
--- old/xattr-0.9.7/xattr/tests/__init__.py     2019-12-02 22:56:17.000000000 
+0100
+++ new/xattr-0.9.8/xattr/tests/__init__.py     2021-11-20 16:28:33.000000000 
+0100
@@ -6,6 +6,7 @@
 def all_tests_suite():
     suite = unittest.TestLoader().loadTestsFromNames([
         'xattr.tests.test_xattr',
+        'xattr.tests.test_tool',
     ])
     return suite
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/xattr/tests/test_tool.py 
new/xattr-0.9.8/xattr/tests/test_tool.py
--- old/xattr-0.9.7/xattr/tests/test_tool.py    1970-01-01 01:00:00.000000000 
+0100
+++ new/xattr-0.9.8/xattr/tests/test_tool.py    2021-11-20 16:28:33.000000000 
+0100
@@ -0,0 +1,117 @@
+import contextlib
+import errno
+import io
+import os
+import shutil
+import sys
+import tempfile
+import unittest
+import uuid
+
+import xattr
+import xattr.tool
+
+
+class TestTool(unittest.TestCase):
+    def setUp(self):
+        self.test_dir = tempfile.mkdtemp()
+        self.addCleanup(shutil.rmtree, self.test_dir)
+
+        orig_stdout = sys.stdout
+
+        def unpatch_stdout(sys=sys, orig_stdout=orig_stdout):
+            sys.stdout = orig_stdout
+
+        self.addCleanup(unpatch_stdout)
+        sys.stdout = self.mock_stdout = io.StringIO()
+
+    def getoutput(self):
+        value = self.mock_stdout.getvalue()
+        self.mock_stdout.seek(0)
+        self.mock_stdout.truncate(0)
+        return value
+
+    @contextlib.contextmanager
+    def temp_file(self):
+        test_file = os.path.join(self.test_dir, str(uuid.uuid4()))
+        fd = os.open(test_file, os.O_CREAT | os.O_WRONLY)
+        try:
+            yield test_file, fd
+        finally:
+            os.close(fd)
+
+    def set_xattr(self, fd, name, value):
+        try:
+            xattr.setxattr(fd, name, value)
+        except OSError as e:
+            if e.errno == errno.ENOTSUP:
+                raise unittest.SkipTest('xattrs are not supported')
+            raise
+
+    def test_utf8(self):
+        with self.temp_file() as (file_path, fd):
+            self.set_xattr(fd, 'user.test-utf8',
+                           u'\N{SNOWMAN}'.encode('utf8'))
+            self.set_xattr(fd, 'user.test-utf8-and-nul',
+                           u'\N{SNOWMAN}\0'.encode('utf8'))
+
+        xattr.tool.main(['prog', '-p', 'user.test-utf8', file_path])
+        self.assertEqual(u'\N{SNOWMAN}\n', self.getoutput())
+
+        xattr.tool.main(['prog', '-p', 'user.test-utf8-and-nul', file_path])
+        self.assertEqual(u'''
+0000   E2 98 83 00                                        ....
+
+'''.lstrip(), self.getoutput())
+
+        xattr.tool.main(['prog', '-l', file_path])
+        output = self.getoutput()
+        self.assertIn(u'user.test-utf8: \N{SNOWMAN}\n', output)
+        self.assertIn(u'''
+user.test-utf8-and-nul:
+0000   E2 98 83 00                                        ....
+
+'''.lstrip(), output)
+
+    def test_non_utf8(self):
+        with self.temp_file() as (file_path, fd):
+            self.set_xattr(fd, 'user.test-not-utf8', b'cannot\xffdecode')
+
+        xattr.tool.main(['prog', '-p', 'user.test-not-utf8', file_path])
+        self.assertEqual(u'''
+0000   63 61 6E 6E 6F 74 FF 64 65 63 6F 64 65             cannot.decode
+
+'''.lstrip(), self.getoutput())
+
+        xattr.tool.main(['prog', '-l', file_path])
+        self.assertIn(u'''
+user.test-not-utf8:
+0000   63 61 6E 6E 6F 74 FF 64 65 63 6F 64 65             cannot.decode
+
+'''.lstrip(), self.getoutput())
+
+    def test_nul(self):
+        with self.temp_file() as (file_path, fd):
+            self.set_xattr(fd, 'user.test', b'foo\0bar')
+            self.set_xattr(fd, 'user.test-long',
+                           b'some rather long value with\0nul\0chars in it')
+
+        xattr.tool.main(['prog', '-p', 'user.test', file_path])
+        self.assertEqual(u'''
+0000   66 6F 6F 00 62 61 72                               foo.bar
+
+'''.lstrip(), self.getoutput())
+
+        xattr.tool.main(['prog', '-p', 'user.test-long', file_path])
+        self.assertEqual(u'''
+0000   73 6F 6D 65 20 72 61 74 68 65 72 20 6C 6F 6E 67    some rather long
+0010   20 76 61 6C 75 65 20 77 69 74 68 00 6E 75 6C 00     value with.nul.
+0020   63 68 61 72 73 20 69 6E 20 69 74                   chars in it
+
+'''.lstrip(), self.getoutput())
+
+        xattr.tool.main(['prog', '-l', file_path])
+        self.assertIn(u'''
+0000   66 6F 6F 00 62 61 72                               foo.bar
+
+'''.lstrip(), self.getoutput())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/xattr/tool.py 
new/xattr-0.9.8/xattr/tool.py
--- old/xattr-0.9.7/xattr/tool.py       2019-12-02 22:56:17.000000000 +0100
+++ new/xattr-0.9.8/xattr/tool.py       2021-11-20 16:28:33.000000000 +0100
@@ -62,12 +62,19 @@
     print("  -z: compress or decompress (if compressed) attribute value in zip 
format")
 
     if e:
-        sys.exit(64)
+        return 64
     else:
-        sys.exit(0)
+        return 0
 
 
-_FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or '.' for x in 
range(256)])
+if sys.version_info < (3,):
+    ascii = repr
+    uchr = unichr
+else:
+    uchr = chr
+
+
+_FILTER = u''.join([(len(ascii(chr(x))) == 3) and uchr(x) or u'.' for x in 
range(256)])
 
 
 def _dump(src, length=16):
@@ -80,11 +87,11 @@
     return ''.join(result)
 
 
-def main():
+def main(argv):
     try:
-        (optargs, args) = getopt.getopt(sys.argv[1:], "hlpwdzs", ["help"])
+        (optargs, args) = getopt.getopt(argv[1:], "hlpwdzs", ["help"])
     except getopt.GetoptError as e:
-        usage(e)
+        return usage(e)
 
     attr_name = None
     long_format = False
@@ -98,7 +105,7 @@
 
     for opt, arg in optargs:
         if opt in ("-h", "--help"):
-            usage()
+            return usage()
         elif opt == "-l":
             long_format = True
         elif opt == "-s":
@@ -106,31 +113,31 @@
         elif opt == "-p":
             read = True
             if write or delete:
-                usage("-p not allowed with -w or -d")
+                return usage("-p not allowed with -w or -d")
         elif opt == "-w":
             write = True
             if read or delete:
-                usage("-w not allowed with -p or -d")
+                return usage("-w not allowed with -p or -d")
         elif opt == "-d":
             delete = True
             if read or write:
-                usage("-d not allowed with -p or -w")
+                return usage("-d not allowed with -p or -w")
         elif opt == "-z":
             compress = zlib.compress
             decompress = zlib.decompress
 
     if write or delete:
         if long_format:
-            usage("-l not allowed with -w or -p")
+            return usage("-l not allowed with -w or -p")
 
     if read or write or delete:
         if not args:
-            usage("No attr_name")
+            return usage("No attr_name")
         attr_name = args.pop(0)
 
     if write:
         if not args:
-            usage("No attr_value")
+            return usage("No attr_value")
         attr_value = args.pop(0).encode('utf-8')
 
     if len(args) > 1:
@@ -188,31 +195,42 @@
                 file_prefix = ""
 
             for attr_name in attr_names:
+                should_dump = False
                 try:
                     try:
                         attr_value = decompress(attrs[attr_name])
                     except zlib.error:
                         attr_value = attrs[attr_name]
-                    attr_value = attr_value.decode('utf-8')
+                    try:
+                        if b'\0' in attr_value:
+                            # force dumping
+                            raise NullsInString
+                        attr_value = attr_value.decode('utf-8')
+                    except (UnicodeDecodeError, NullsInString):
+                        attr_value = attr_value.decode('latin-1')
+                        should_dump = True
                 except KeyError:
                     onError("%sNo such xattr: %s" % (file_prefix, attr_name))
                     continue
 
                 if long_format:
-                    try:
-                        if '\0' in attr_value:
-                            raise NullsInString
-                        print("".join((file_prefix, "%s: " % (attr_name,), 
attr_value)))
-                    except (UnicodeDecodeError, NullsInString):
+                    if should_dump:
                         print("".join((file_prefix, "%s:" % (attr_name,))))
                         print(_dump(attr_value))
+                    else:
+                        print("".join((file_prefix, "%s: " % (attr_name,), 
attr_value)))
                 else:
                     if read:
-                        print("".join((file_prefix, attr_value)))
+                        if should_dump:
+                            if file_prefix:
+                                print(file_prefix)
+                            print(_dump(attr_value))
+                        else:
+                            print("".join((file_prefix, attr_value)))
                     else:
                         print("".join((file_prefix, attr_name)))
 
-    sys.exit(status)
+    return status
 
 if __name__ == "__main__":
-    main()
+    sys.exit(main(sys.argv))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/xattr.egg-info/PKG-INFO 
new/xattr-0.9.8/xattr.egg-info/PKG-INFO
--- old/xattr-0.9.7/xattr.egg-info/PKG-INFO     2019-12-02 23:08:51.000000000 
+0100
+++ new/xattr-0.9.8/xattr.egg-info/PKG-INFO     2021-11-20 16:28:36.000000000 
+0100
@@ -1,19 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: xattr
-Version: 0.9.7
+Version: 0.9.8
 Summary: Python wrapper for extended filesystem attributes
 Home-page: http://github.com/xattr/xattr
 Author: Bob Ippolito
 Author-email: b...@redivi.com
 License: MIT License
-Description: 
-        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.
-        
 Platform: MacOS X
 Platform: Linux
 Platform: FreeBSD
@@ -29,3 +21,14 @@
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 3
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
+License-File: LICENSE.txt
+
+
+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.9.7/xattr.egg-info/SOURCES.txt 
new/xattr-0.9.8/xattr.egg-info/SOURCES.txt
--- old/xattr-0.9.7/xattr.egg-info/SOURCES.txt  2019-12-02 23:08:52.000000000 
+0100
+++ new/xattr-0.9.8/xattr.egg-info/SOURCES.txt  2021-11-20 16:28:36.000000000 
+0100
@@ -4,6 +4,7 @@
 MANIFEST.in
 README.rst
 TODO.txt
+pyproject.toml
 requirements.txt
 setup.py
 xattr/__init__.py
@@ -22,4 +23,5 @@
 xattr.egg-info/requires.txt
 xattr.egg-info/top_level.txt
 xattr/tests/__init__.py
+xattr/tests/test_tool.py
 xattr/tests/test_xattr.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xattr-0.9.7/xattr.egg-info/requires.txt 
new/xattr-0.9.8/xattr.egg-info/requires.txt
--- old/xattr-0.9.7/xattr.egg-info/requires.txt 2019-12-02 23:08:51.000000000 
+0100
+++ new/xattr-0.9.8/xattr.egg-info/requires.txt 2021-11-20 16:28:36.000000000 
+0100
@@ -1 +1 @@
-cffi>=1.0.0
+cffi>=1.0

Reply via email to