15
0

- Add patch support-python-311.patch:

* http.cookiejar changed behaviour from Python 3.11 onwards, support
    both.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mechanize?expand=0&rev=56
This commit is contained in:
2023-03-31 07:06:23 +00:00
committed by Git OBS Bridge
parent 7f7367221a
commit 7f16d7b91f
3 changed files with 47 additions and 4 deletions

35
support-python-311.patch Normal file
View File

@@ -0,0 +1,35 @@
Index: mechanize-0.4.8/test/test_cookies.py
===================================================================
--- mechanize-0.4.8.orig/test/test_cookies.py
+++ mechanize-0.4.8/test/test_cookies.py
@@ -1015,13 +1015,23 @@ class CookieTests(unittest.TestCase):
r'port="90,100, 80,8080"; '
r'max-age=100; Comment = "Just kidding! (\"|\\\\) "')
- versions = [1, 1, 1, 0, 1]
- names = ["bang", "foo", "foo", "spam", "foo"]
- domains = [
- ".sol.no", "blah.spam.org", "www.acme.com", "www.acme.com",
- "www.acme.com"
- ]
- paths = ["/", "/", "/", "/blah", "/blah/"]
+ # Python 3.11+ no longer sort cookies when returning them.
+ if sys.version_info >= (3, 11):
+ versions = [1, 0, 1, 1, 1]
+ names = ["foo", "spam", "foo", "foo", "bang"]
+ domains = [
+ "blah.spam.org", "www.acme.com", "www.acme.com",
+ "www.acme.com", ".sol.no"
+ ]
+ paths = ["/", "/blah", "/blah/", "/", "/"]
+ else:
+ versions = [1, 1, 1, 0, 1]
+ names = ["bang", "foo", "foo", "spam", "foo"]
+ domains = [
+ ".sol.no", "blah.spam.org", "www.acme.com", "www.acme.com",
+ "www.acme.com"
+ ]
+ paths = ["/", "/", "/", "/blah", "/blah/"]
# sequential iteration
for i in range(4):