summaryrefslogtreecommitdiff
path: root/dev-python
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@gentoo.org>2025-08-27 00:45:08 -0400
committerEli Schwartz <eschwartz@gentoo.org>2025-08-27 01:36:18 -0400
commit2ea990794b81aa47c02119dfcbe614977f73f9a7 (patch)
treee3e6153cf631c33f9dd14f999974f7062292dde5 /dev-python
parent69ed4c1aaa0dc2fbcc67d1c07f3e1a88217cce71 (diff)
downloadgentoo-2ea990794b81aa47c02119dfcbe614977f73f9a7.tar.gz
gentoo-2ea990794b81aa47c02119dfcbe614977f73f9a7.tar.bz2
gentoo-2ea990794b81aa47c02119dfcbe614977f73f9a7.zip
dev-python/mechanize: backport test fix for cpython changes backported in 3.13
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/mechanize/files/mechanize-0.4.10-py314-tests.patch33
-rw-r--r--dev-python/mechanize/mechanize-0.4.10.ebuild7
2 files changed, 39 insertions, 1 deletions
diff --git a/dev-python/mechanize/files/mechanize-0.4.10-py314-tests.patch b/dev-python/mechanize/files/mechanize-0.4.10-py314-tests.patch
new file mode 100644
index 000000000000..c5ba8eb43f56
--- /dev/null
+++ b/dev-python/mechanize/files/mechanize-0.4.10-py314-tests.patch
@@ -0,0 +1,33 @@
+From 0c1cd4b65697dee4e4192902c9a2965d94700502 Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@debian.org>
+Date: Mon, 26 May 2025 12:59:44 +0100
+Subject: [PATCH] Fix CookieTests following fix for CPython #130631
+
+The fix for https://github.com/python/cpython/issues/130631 in Python
+3.14.0b1 (also cherry-picked to 3.13, but not yet released) causes
+`www.acme.com` to be unquoted in cookie strings. Adjust a test to cope
+with this.
+---
+ test/test_cookies.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/test/test_cookies.py b/test/test_cookies.py
+index ec0c2ff..92227fc 100644
+--- a/test/test_cookies.py
++++ b/test/test_cookies.py
+@@ -332,9 +332,13 @@ def test_missing_name(self):
+ cookie = c._cookies["www.acme.com"]['/foo/']['"spam"']
+ assert cookie.name == '"spam"'
+ assert cookie.value is None
+- assert lwp_cookie_str(cookie) == (
++ assert lwp_cookie_str(cookie) in (
++ r'"spam"; path="/foo/"; domain=www.acme.com; '
++ 'path_spec; discard; version=0',
++ # prior to fix for https://github.com/python/cpython/issues/130631:
+ r'"spam"; path="/foo/"; domain="www.acme.com"; '
+- 'path_spec; discard; version=0')
++ 'path_spec; discard; version=0',
++ )
+ old_str = repr(c)
+ c.save(ignore_expires=True, ignore_discard=True)
+ try:
diff --git a/dev-python/mechanize/mechanize-0.4.10.ebuild b/dev-python/mechanize/mechanize-0.4.10.ebuild
index 43fea3363923..2a29cbbb5e7f 100644
--- a/dev-python/mechanize/mechanize-0.4.10.ebuild
+++ b/dev-python/mechanize/mechanize-0.4.10.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -29,6 +29,11 @@ BDEPEND="
)
"
+PATCHES=(
+ # https://github.com/python-mechanize/mechanize/pull/102
+ "${FILESDIR}"/${P}-py314-tests.patch
+)
+
python_test() {
"${EPYTHON}" run_tests.py -v || die
}