| 1 |
From: Colin Watson <[email protected]> |
| 2 |
Date: Mon, 26 May 2025 12:59:44 +0100 |
| 3 |
Subject: Fix CookieTests following fix for CPython #130631 |
| 4 |
|
| 5 |
The fix for https://github.com/python/cpython/issues/130631 in Python |
| 6 |
3.14.0b1 (also cherry-picked to 3.13, but not yet released) causes |
| 7 |
`www.acme.com` to be unquoted in cookie strings. Adjust a test to cope |
| 8 |
with this. |
| 9 |
|
| 10 |
Forwarded: https://github.com/python-mechanize/mechanize/pull/102 |
| 11 |
Bug-Debian: https://bugs.debian.org/1106440 |
| 12 |
Last-Update: 2025-05-26 |
| 13 |
--- |
| 14 |
test/test_cookies.py | 8 ++++++-- |
| 15 |
1 file changed, 6 insertions(+), 2 deletions(-) |
| 16 |
|
| 17 |
diff --git a/test/test_cookies.py b/test/test_cookies.py |
| 18 |
index ec0c2ff..92227fc 100644 |
| 19 |
--- a/test/test_cookies.py |
| 20 |
+++ b/test/test_cookies.py |
| 21 |
@@ -332,9 +332,13 @@ class CookieTests(unittest.TestCase): |
| 22 |
cookie = c._cookies["www.acme.com"]['/foo/']['"spam"'] |
| 23 |
assert cookie.name == '"spam"' |
| 24 |
assert cookie.value is None |
| 25 |
- assert lwp_cookie_str(cookie) == ( |
| 26 |
+ assert lwp_cookie_str(cookie) in ( |
| 27 |
+ r'"spam"; path="/foo/"; domain=www.acme.com; ' |
| 28 |
+ 'path_spec; discard; version=0', |
| 29 |
+ # prior to fix for https://github.com/python/cpython/issues/130631: |
| 30 |
r'"spam"; path="/foo/"; domain="www.acme.com"; ' |
| 31 |
- 'path_spec; discard; version=0') |
| 32 |
+ 'path_spec; discard; version=0', |
| 33 |
+ ) |
| 34 |
old_str = repr(c) |
| 35 |
c.save(ignore_expires=True, ignore_discard=True) |
| 36 |
try: |