Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-zlib-ng for openSUSE:Factory 
checked in at 2024-03-17 22:15:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zlib-ng (Old)
 and      /work/SRC/openSUSE:Factory/.python-zlib-ng.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-zlib-ng"

Sun Mar 17 22:15:34 2024 rev:2 rq:1158509 version:0.4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-zlib-ng/python-zlib-ng.changes    
2024-02-07 18:53:02.244735204 +0100
+++ /work/SRC/openSUSE:Factory/.python-zlib-ng.new.1905/python-zlib-ng.changes  
2024-03-17 22:16:10.780774732 +0100
@@ -1,0 +2,8 @@
+Sat Mar 16 14:42:27 UTC 2024 - Dirk Müller <dmuel...@suse.com>
+
+- update to 0.4.1:
+  * Fix a bug where streams that were passed to
+    gzip_ng_threaded.open where closed.
+  * Fix compatibility with Python 3.13
+
+-------------------------------------------------------------------

Old:
----
  zlib-ng-0.4.0.tar.gz

New:
----
  zlib-ng-0.4.1.tar.gz

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

Other differences:
------------------
++++++ python-zlib-ng.spec ++++++
--- /var/tmp/diff_new_pack.0gDIpC/_old  2024-03-17 22:16:13.228864541 +0100
+++ /var/tmp/diff_new_pack.0gDIpC/_new  2024-03-17 22:16:13.240864981 +0100
@@ -26,7 +26,7 @@
 %endif
 
 Name:           python-zlib-ng%{psuffix}
-Version:        0.4.0
+Version:        0.4.1
 Release:        0
 License:        Python-2.0
 Summary:        Faster zlib and gzip compatible compression and decompression




++++++ zlib-ng-0.4.0.tar.gz -> zlib-ng-0.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zlib-ng-0.4.0/PKG-INFO new/zlib-ng-0.4.1/PKG-INFO
--- old/zlib-ng-0.4.0/PKG-INFO  2023-12-25 17:21:47.373360200 +0100
+++ new/zlib-ng-0.4.1/PKG-INFO  2024-03-11 14:35:03.671692400 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: zlib-ng
-Version: 0.4.0
+Version: 0.4.1
 Summary: Drop-in replacement for zlib and gzip modules using zlib-ng
 Home-page: https://github.com/pycompression/python-zlib-ng
 Author: Leiden University Medical Center
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zlib-ng-0.4.0/setup.py new/zlib-ng-0.4.1/setup.py
--- old/zlib-ng-0.4.0/setup.py  2023-12-25 17:17:31.000000000 +0100
+++ new/zlib-ng-0.4.1/setup.py  2024-03-11 14:30:56.000000000 +0100
@@ -123,7 +123,7 @@
 
 setup(
     name="zlib-ng",
-    version="0.4.0",
+    version="0.4.1",
     description="Drop-in replacement for zlib and gzip modules using zlib-ng",
     author="Leiden University Medical Center",
     author_email="r.h.p.vorder...@lumc.nl",  # A placeholder for now
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zlib-ng-0.4.0/src/zlib_ng/__init__.py 
new/zlib-ng-0.4.1/src/zlib_ng/__init__.py
--- old/zlib-ng-0.4.0/src/zlib_ng/__init__.py   2023-12-25 17:17:31.000000000 
+0100
+++ new/zlib-ng-0.4.1/src/zlib_ng/__init__.py   2024-03-11 14:30:56.000000000 
+0100
@@ -5,4 +5,4 @@
 # This file is part of python-zlib-ng which is distributed under the
 # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2.
 
-__version__ = "0.4.0"
+__version__ = "0.4.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zlib-ng-0.4.0/src/zlib_ng/gzip_ng_threaded.py 
new/zlib-ng-0.4.1/src/zlib_ng/gzip_ng_threaded.py
--- old/zlib-ng-0.4.0/src/zlib_ng/gzip_ng_threaded.py   2023-12-25 
17:17:31.000000000 +0100
+++ new/zlib-ng-0.4.1/src/zlib_ng/gzip_ng_threaded.py   2024-03-11 
14:30:56.000000000 +0100
@@ -78,16 +78,18 @@
 def open_as_binary_stream(filename, open_mode):
     if isinstance(filename, (str, bytes)) or hasattr(filename, "__fspath__"):
         binary_file = builtins.open(filename, open_mode)
+        closefd = True
     elif hasattr(filename, "read") or hasattr(filename, "write"):
         binary_file = filename
+        closefd = False
     else:
         raise TypeError("filename must be a str or bytes object, or a file")
-    return binary_file
+    return binary_file, closefd
 
 
 class _ThreadedGzipReader(io.RawIOBase):
     def __init__(self, filename, queue_size=2, block_size=1024 * 1024):
-        self.raw = open_as_binary_stream(filename, "rb")
+        self.raw, self.closefd = open_as_binary_stream(filename, "rb")
         self.fileobj = zlib_ng._GzipReader(self.raw, buffersize=8 * block_size)
         self.pos = 0
         self.read_file = False
@@ -155,7 +157,8 @@
         self.running = False
         self.worker.join()
         self.fileobj.close()
-        self.raw.close()
+        if self.closefd:
+            self.raw.close()
         self._closed = True
 
     @property
@@ -246,7 +249,7 @@
         self._crc = 0
         self.running = False
         self._size = 0
-        self.raw = open_as_binary_stream(filename, mode)
+        self.raw, self.closefd = open_as_binary_stream(filename, mode)
         self._closed = False
         self._write_gzip_header()
         self.start()
@@ -334,7 +337,8 @@
         trailer = struct.pack("<II", self._crc, self._size & 0xFFFFFFFF)
         self.raw.write(trailer)
         self.raw.flush()
-        self.raw.close()
+        if self.closefd:
+            self.raw.close()
         self._closed = True
 
     @property
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zlib-ng-0.4.0/src/zlib_ng/zlib_ngmodule.c 
new/zlib-ng-0.4.1/src/zlib_ng/zlib_ngmodule.c
--- old/zlib-ng-0.4.0/src/zlib_ng/zlib_ngmodule.c       2023-12-25 
17:17:31.000000000 +0100
+++ new/zlib-ng-0.4.1/src/zlib_ng/zlib_ngmodule.c       2024-03-11 
14:30:56.000000000 +0100
@@ -2810,7 +2810,7 @@
         Py_DECREF(chunk_list);
         return NULL;
     }
-    PyObject *ret = _PyBytes_Join(empty_bytes, chunk_list);
+    PyObject *ret = PyObject_CallMethod(empty_bytes, "join", "O", chunk_list);
     Py_DECREF(empty_bytes);
     Py_DECREF(chunk_list);
     return ret;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zlib-ng-0.4.0/src/zlib_ng.egg-info/PKG-INFO 
new/zlib-ng-0.4.1/src/zlib_ng.egg-info/PKG-INFO
--- old/zlib-ng-0.4.0/src/zlib_ng.egg-info/PKG-INFO     2023-12-25 
17:21:47.000000000 +0100
+++ new/zlib-ng-0.4.1/src/zlib_ng.egg-info/PKG-INFO     2024-03-11 
14:35:03.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: zlib-ng
-Version: 0.4.0
+Version: 0.4.1
 Summary: Drop-in replacement for zlib and gzip modules using zlib-ng
 Home-page: https://github.com/pycompression/python-zlib-ng
 Author: Leiden University Medical Center
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zlib-ng-0.4.0/tests/test_gzip_ng_threaded.py 
new/zlib-ng-0.4.1/tests/test_gzip_ng_threaded.py
--- old/zlib-ng-0.4.0/tests/test_gzip_ng_threaded.py    2023-12-25 
17:17:31.000000000 +0100
+++ new/zlib-ng-0.4.1/tests/test_gzip_ng_threaded.py    2024-03-11 
14:30:56.000000000 +0100
@@ -190,3 +190,22 @@
     with gzip.open(test_file, "rt") as f:
         contents = f.read()
     assert contents == "ABCD"
+
+
+def test_threaded_reader_does_not_close_stream():
+    test_stream = io.BytesIO()
+    test_stream.write(gzip.compress(b"thisisatest"))
+    test_stream.seek(0)
+    with gzip_ng_threaded.open(test_stream, "rb") as f:
+        text = f.read()
+    assert not test_stream.closed
+    assert text == b"thisisatest"
+
+
+def test_threaded_writer_does_not_close_stream():
+    test_stream = io.BytesIO()
+    with gzip_ng_threaded.open(test_stream, "wb") as f:
+        f.write(b"thisisatest")
+    assert not test_stream.closed
+    test_stream.seek(0)
+    assert gzip.decompress(test_stream.read()) == b"thisisatest"

Reply via email to