public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-urllib3] f45: Fix a regression with Python 3.14.8
@ 2026-10-13 7:18 Benjamin A. Beasley
0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-10-13 7:18 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-urllib3
Branch : f45
Commit : f99bffa115b820acdfd0a80c48955496514d662c
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date : 2026-10-13T07:30:51+01:00
Stats : +72/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-urllib3/c/f99bffa115b820acdfd0a80c48955496514d662c?branch=f45
Log:
Fix a regression with Python 3.14.8
---
diff --git a/48113e7a5fa3b98a61467afa6bcbb0f9b7ca7207.patch b/48113e7a5fa3b98a61467afa6bcbb0f9b7ca7207.patch
new file mode 100644
index 0000000..f86ce48
--- /dev/null
+++ b/48113e7a5fa3b98a61467afa6bcbb0f9b7ca7207.patch
@@ -0,0 +1,63 @@
+From 48113e7a5fa3b98a61467afa6bcbb0f9b7ca7207 Mon Sep 17 00:00:00 2001
+From: "Mohamed A. Ali" <133538288+Mohamedajab@users.noreply.github.com>
+Date: Thu, 24 Sep 2026 15:51:13 +0100
+Subject: [PATCH] Keep gzip flush from resurfacing ignored errors on newer
+ Python (#5271)
+
+---
+ changelog/5268.bugfix.rst | 2 ++
+ src/urllib3/response.py | 2 ++
+ test/test_response.py | 11 +++++++++++
+ 3 files changed, 15 insertions(+)
+ create mode 100644 changelog/5268.bugfix.rst
+
+diff --git a/changelog/5268.bugfix.rst b/changelog/5268.bugfix.rst
+new file mode 100644
+index 0000000000..285f45487a
+--- /dev/null
++++ b/changelog/5268.bugfix.rst
+@@ -0,0 +1,2 @@
++Prevented a suppressed :class:`GzipDecoder` decompression error caused by invalid
++trailing data from resurfacing during ``flush()`` on newer Python versions.
+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/python-urllib3.spec b/python-urllib3.spec
index e2dc379..b4b89ed 100644
--- a/python-urllib3.spec
+++ b/python-urllib3.spec
@@ -33,7 +33,15 @@ Source1: %{hypercorn_url}/archive/%{hypercorn_commit}/hypercorn-%{hyperco
# fix ValueError: check_hostname requires server_hostname with latest Python
# https://github.com/urllib3/urllib3/pull/5289
-Patch0: %{url}/commit/be5a3f30aae8e0ee89759083b8ec01cfe8d60195.patch
+Patch: %{url}/commit/be5a3f30aae8e0ee89759083b8ec01cfe8d60195.patch
+# Avoid flushing swallowed gzip trailing garbage
+# https://github.com/urllib3/urllib3/pull/5271
+#
+# Fixes:
+#
+# test_response.py fails with Python >= 3.14.8 (unreleased)
+# https://github.com/urllib3/urllib3/issues/5268
+Patch: %{url}/commit/48113e7a5fa3b98a61467afa6bcbb0f9b7ca7207.patch
BuildArch: noarch
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-13 7:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 7:18 [rpms/python-urllib3] f45: Fix a regression with Python 3.14.8 Benjamin A. Beasley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox