File: 0003-py314-cookie-test.patch

package info (click to toggle)
python-mechanize 1%3A0.4.10%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,316 kB
  • sloc: python: 16,656; makefile: 11; sh: 4
file content (36 lines) | stat: -rw-r--r-- 1,467 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Colin Watson <cjwatson@debian.org>
Date: Mon, 26 May 2025 12:59:44 +0100
Subject: 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.

Forwarded: https://github.com/python-mechanize/mechanize/pull/102
Bug-Debian: https://bugs.debian.org/1106440
Last-Update: 2025-05-26
---
 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 @@ class CookieTests(unittest.TestCase):
         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: