From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/urllib3/, dev-python/urllib3/files/
Date: Fri, 16 Feb 2024 17:16:46 +0000 (UTC) [thread overview]
Message-ID: <1708103752.c886664d717e65f9496d9fdb31e71f89d4ad5e98.mgorny@gentoo> (raw)
commit: c886664d717e65f9496d9fdb31e71f89d4ad5e98
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 16 17:05:00 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Feb 16 17:15:52 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c886664d
dev-python/urllib3: Backport an upstream revert to fix regressions
Closes: https://bugs.gentoo.org/924333
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../urllib3/files/urllib3-2.2.0-revert.patch | 42 ++++++++++++++++++++++
...rllib3-2.2.0.ebuild => urllib3-2.2.0-r1.ebuild} | 5 +++
2 files changed, 47 insertions(+)
diff --git a/dev-python/urllib3/files/urllib3-2.2.0-revert.patch b/dev-python/urllib3/files/urllib3-2.2.0-revert.patch
new file mode 100644
index 000000000000..14175ecec58b
--- /dev/null
+++ b/dev-python/urllib3/files/urllib3-2.2.0-revert.patch
@@ -0,0 +1,42 @@
+From 49b2ddaf07ec9ef65ef12d0218117f20e739ee6e Mon Sep 17 00:00:00 2001
+From: Quentin Pradet <quentin.pradet@gmail.com>
+Date: Fri, 16 Feb 2024 11:35:30 +0400
+Subject: [PATCH] Stop casting request headers to HTTPHeaderDict (#3344)
+
+While this was done to fix a mypy error, we did not notice the
+consequences:
+
+ * This breaks boto3 that subclasses HTTPConnection because
+ HTTPHeaderDict does not support bytes values yet.
+ * When proxying, headers are still a dictionary by default.
+
+We can decide to reintroduce a forced conversion to HTTPHeaderDict in
+urllib3 3.0 if the above issues are fixed.
+---
+ changelog/3343.bugfix.rst | 1 +
+ src/urllib3/connectionpool.py | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+ create mode 100644 changelog/3343.bugfix.rst
+
+diff --git a/changelog/3343.bugfix.rst b/changelog/3343.bugfix.rst
+new file mode 100644
+index 0000000000..4f2df9e7a4
+--- /dev/null
++++ b/changelog/3343.bugfix.rst
+@@ -0,0 +1 @@
++Fixed ``HTTPConnectionPool.urlopen`` to stop automatically casting non-proxy headers to ``HTTPHeaderDict``. This change was premature as it did not apply to proxy headers and ``HTTPHeaderDict`` does not handle byte header values correctly yet.
+diff --git a/src/urllib3/connectionpool.py b/src/urllib3/connectionpool.py
+index 1036f0d718..bd58ff14dd 100644
+--- a/src/urllib3/connectionpool.py
++++ b/src/urllib3/connectionpool.py
+@@ -751,8 +751,8 @@ def urlopen( # type: ignore[override]
+ # have to copy the headers dict so we can safely change it without those
+ # changes being reflected in anyone else's copy.
+ if not http_tunnel_required:
+- headers = HTTPHeaderDict(headers)
+- headers.update(self.proxy_headers)
++ headers = headers.copy() # type: ignore[attr-defined]
++ headers.update(self.proxy_headers) # type: ignore[union-attr]
+
+ # Must keep the exception bound to a separate variable or else Python 3
+ # complains about UnboundLocalError.
diff --git a/dev-python/urllib3/urllib3-2.2.0.ebuild b/dev-python/urllib3/urllib3-2.2.0-r1.ebuild
similarity index 95%
rename from dev-python/urllib3/urllib3-2.2.0.ebuild
rename to dev-python/urllib3/urllib3-2.2.0-r1.ebuild
index eb55415eb52a..bdcc50c7b073 100644
--- a/dev-python/urllib3/urllib3-2.2.0.ebuild
+++ b/dev-python/urllib3/urllib3-2.2.0-r1.ebuild
@@ -66,6 +66,11 @@ BDEPEND="
"
src_prepare() {
+ local PATCHES=(
+ # https://github.com/urllib3/urllib3/commit/49b2ddaf07ec9ef65ef12d0218117f20e739ee6e
+ "${FILESDIR}/${P}-revert.patch"
+ )
+
# upstream considers 0.5 s to be "long" for a timeout
# we get tons of test failures on *fast* systems because of that
sed -i -e '/LONG_TIMEOUT/s:0.5:5:' test/__init__.py || die
next reply other threads:[~2024-02-16 17:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-16 17:16 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-15 8:52 [gentoo-commits] repo/gentoo:master commit in: dev-python/urllib3/, dev-python/urllib3/files/ Michał Górny
2020-12-23 2:03 Sam James
2018-07-14 10:40 Michał Górny
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=1708103752.c886664d717e65f9496d9fdb31e71f89d4ad5e98.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.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