1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-26 12:45:20 +03:00
aports/testing/py3-furl/python-3.9.patch
2021-04-05 18:19:23 +00:00

61 lines
2.4 KiB
Diff

From 322a20bd04e589a3d633a1c461d3d7d937f52b4e Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
Date: Mon, 29 Mar 2021 23:57:39 +0200
Subject: [PATCH] urllib changed behavior in Py 3.9
---
tests/test_furl.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/test_furl.py b/tests/test_furl.py
index 25e8a9c..e9a39d3 100644
--- a/tests/test_furl.py
+++ b/tests/test_furl.py
@@ -14,6 +14,7 @@
import warnings
from abc import ABCMeta, abstractmethod
+import sys
import six
from six.moves import zip
@@ -2055,9 +2056,13 @@ def test_join(self):
assert f.url == 'http://pepp.ru/a/b/c#uwantpump?'
# In edge cases (e.g. URLs without an authority/netloc), behave
- # identically to urllib.parse.urljoin().
+ # identically to urllib.parse.urljoin(), which changed behavior
+ # in Python 3.9
f = furl.furl('wss://slrp.com/').join('foo:1')
- assert f.url == 'wss://slrp.com/foo:1'
+ if sys.version_info[:2] < (3, 9):
+ assert f.url == 'wss://slrp.com/foo:1'
+ else:
+ assert f.url == 'foo:1'
f = furl.furl('wss://slrp.com/').join('foo:1:rip')
assert f.url == 'foo:1:rip'
f = furl.furl('scheme:path').join('foo:blah')
--- a/tests/test_furl.py
+++ b/tests/test_furl.py
@@ -602,17 +602,17 @@ class TestQuery(unittest.TestCase):
'space=a+a&amp=a%26a', 'a a=a a&no encoding=sup', 'a+a=a+a',
'a%20=a+a', 'a%20a=a%20a', 'a+a=a%20a', 'space=a a&amp=a^a',
'a=a&s=s#s', '+=+', "/?:@-._~!$&'()*+,=/?:@-._~!$'()*+,=",
- 'a=a&c=c%5Ec', '<=>&^="', '%3C=%3E&%5E=%22', '%=%;`=`',
+ 'a=a&c=c%5Ec', '<=>&^="', '%3C=%3E&%5E=%22', '%=%&`=`',
'%25=%25&%60=%60',
# Only keys, no values.
'asdfasdf', '/asdf/asdf/sdf', '*******', '!@#(*&@!#(*@!#', 'a&b',
- 'a;b',
+ 'a&b',
# Repeated parameters.
'a=a&a=a', 'space=a+a&space=b+b',
# Empty keys and/or values.
'=', 'a=', 'a=a&a=', '=a&=b',
- # Semicolon delimiter, like 'a=a;b=b'.
- 'a=a;a=a', 'space=a+a;space=b+b',
+ # Semicolon delimiter is not allowed per default after bpo#42967
+ 'a=a&a=a', 'space=a+a&space=b+b',
]))
self.items = (self.itemlists + self.itemdicts + self.itemomdicts +
self.itemstrs)