[packages/python3-urllib3] Up to 2.8.0

arekm arekm at pld-linux.org
Wed Nov 11 00:22:18 CET 2026


commit fdfd01782801299ae628b5f8c42b4ac0f8f6bc36
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Nov 11 00:21:42 2026 +0100

    Up to 2.8.0
    
    Fixes CVE-2026-97689, CVE-2026-97688, CVE-2026-97687.

 python3-urllib3.spec                     | 11 +++++---
 urllib3-gzip-swallow-flush.patch         | 44 ++++++++++++++++++++++++++++++++
 urllib3-parametrize-list.patch           | 11 --------
 urllib3-test-ssltransport-hostname.patch | 13 ++++++++++
 4 files changed, 64 insertions(+), 15 deletions(-)
---
diff --git a/python3-urllib3.spec b/python3-urllib3.spec
index 7eac948..e500764 100644
--- a/python3-urllib3.spec
+++ b/python3-urllib3.spec
@@ -8,14 +8,15 @@
 Summary:	HTTP library with thread-safe connection pooling, file post, and more
 Summary(pl.UTF-8):	Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
 Name:		python3-%{module}
-Version:	2.7.0
-Release:	3
+Version:	2.8.0
+Release:	1
 License:	MIT
 Group:		Development/Languages/Python
 #Source0Download: https://pypi.org/simple/urllib3/
 Source0:	https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
-# Source0-md5:	e79707b798a66c8165c9c441440f4e80
-Patch0:		urllib3-parametrize-list.patch
+# Source0-md5:	e8ed250b4d520f9e3c0df3165953aa94
+Patch0:		urllib3-gzip-swallow-flush.patch
+Patch1:		urllib3-test-ssltransport-hostname.patch
 URL:		https://urllib3.readthedocs.io/
 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
 BuildRequires:	glibc-localedb-all
@@ -60,6 +61,7 @@ BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 2.044
 %if %{with doc}
 BuildRequires:	python3-furo >= 2024.8.6
+BuildRequires:	python3-myst_parser >= 5.1.0
 BuildRequires:	python3-requests >= 2.32.3
 BuildRequires:	python3-sphinx_copybutton >= 0.5.2
 BuildRequires:	python3-sphinxext.opengraph >= 0.9.1
@@ -103,6 +105,7 @@ Dokumentacja API modułu Pythona urllib3.
 %prep
 %setup -q -n %{module}-%{version}
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 %py3_build_pyproject
diff --git a/urllib3-gzip-swallow-flush.patch b/urllib3-gzip-swallow-flush.patch
new file mode 100644
index 0000000..2f9b4ab
--- /dev/null
+++ b/urllib3-gzip-swallow-flush.patch
@@ -0,0 +1,44 @@
+# gzip flush after swallowed trailing garbage re-raises zlib.error on CPython with gh-156173
+# https://github.com/urllib3/urllib3/pull/5271
+diff --git a/src/urllib3/response.py b/src/urllib3/response.py
+index ec7d308330..3464cf91e3 100644
+--- a/src/urllib3/response.py
++++ b/src/urllib3/response.py
+@@ -205,6 +205,8 @@ def has_unconsumed_tail(self) -> bool:
+         return bool(self._unconsumed_tail)
+ 
+     def flush(self) -> bytes:
++        if self._state == GzipDecoderState.SWALLOW_DATA:
++            return b""
+         return self._obj.flush()
+ 
+ 
+diff --git a/test/test_response.py b/test/test_response.py
+index 24118f6528..287bdc59de 100644
+--- a/test/test_response.py
++++ b/test/test_response.py
+@@ -30,6 +30,7 @@
+     _MAX_CHUNK_LINE_LENGTH,
+     BaseHTTPResponse,
+     BytesQueueBuffer,
++    GzipDecoder,
+     HTTPResponse,
+     brotli,
+ )
+@@ -495,6 +496,16 @@ def test_decode_gzip_swallow_garbage(self) -> None:
+ 
+         assert ret == b"foofoofoo"
+ 
++    def test_decode_gzip_swallow_garbage_does_not_flush(self) -> None:
++        decoder = GzipDecoder()
++        data = gzip.compress(b"foo") + b"garbage"
++
++        assert decoder.decompress(data) == b"foo"
++        decoder._obj = mock.Mock(flush=mock.Mock(side_effect=zlib.error))
++
++        assert decoder.flush() == b""
++        decoder._obj.flush.assert_not_called()
++
+     def test_chunked_decoding_gzip_swallow_garbage(self) -> None:
+         compress = zlib.compressobj(6, zlib.DEFLATED, 16 + zlib.MAX_WBITS)
+         data = compress.compress(b"foo")
diff --git a/urllib3-parametrize-list.patch b/urllib3-parametrize-list.patch
deleted file mode 100644
index dc9189f..0000000
--- a/urllib3-parametrize-list.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- urllib3-2.7.0.orig/test/test_util.py
-+++ urllib3-2.7.0/test/test_util.py
-@@ -307,7 +307,7 @@ class TestUtil:
- 
-     @pytest.mark.parametrize(
-         "url, expected_url",
--        chain(parse_url_host_map, non_round_tripping_parse_url_host_map),
-+        list(chain(parse_url_host_map, non_round_tripping_parse_url_host_map)),
-     )
-     def test_parse_url(self, url: str, expected_url: Url) -> None:
-         returned_url = parse_url(url)
diff --git a/urllib3-test-ssltransport-hostname.patch b/urllib3-test-ssltransport-hostname.patch
new file mode 100644
index 0000000..2b0472e
--- /dev/null
+++ b/urllib3-test-ssltransport-hostname.patch
@@ -0,0 +1,13 @@
+# CPython 3.13.16+ wrap_bio() rejects check_hostname without server_hostname (gh-156793)
+# https://github.com/urllib3/urllib3/pull/5289
+--- a/test/test_ssltransport.py
++++ b/test/test_ssltransport.py
+@@ -135,7 +135,7 @@
+         context = ssl.create_default_context()
+         sock.close()
+         with pytest.raises(OSError):
+-            SSLTransport(sock, context)
++            SSLTransport(sock, context, server_hostname="localhost")
+ 
+     @pytest.mark.timeout(PER_TEST_TIMEOUT)
+     def test_close_after_handshake(self) -> None:
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-urllib3.git/commitdiff/fdfd01782801299ae628b5f8c42b4ac0f8f6bc36



More information about the pld-cvs-commit mailing list