public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-urllib3] rawhide: Fix a regression with Python 3.14.8
Date: Tue, 13 Oct 2026 06:57:49 GMT [thread overview]
Message-ID: <179187466913.1.4909291496922207629.rpms-python-urllib3-f99bffa115b8@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-urllib3
Branch : rawhide
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=rawhide
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
reply other threads:[~2026-10-13 6:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179187466913.1.4909291496922207629.rpms-python-urllib3-f99bffa115b8@fedoraproject.org \
--to=code@musicinmybrain.net \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox