diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2021-04-11 13:26:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-11 13:26:09 (GMT) |
commit | b38601d49675d90e1ee6faa47f7adaeca992d02d (patch) | |
tree | 3e3cd26efa597a83a06208db51450d10e99f2240 /Lib/test/test_urlparse.py | |
parent | 63bf1abfdc2db2798e477c38f41c486e702b7542 (diff) | |
download | cpython-b38601d49675d90e1ee6faa47f7adaeca992d02d.zip cpython-b38601d49675d90e1ee6faa47f7adaeca992d02d.tar.gz cpython-b38601d49675d90e1ee6faa47f7adaeca992d02d.tar.bz2 |
bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (#24818)
* coerce bytes separator to string
* Add news
* Update Misc/NEWS.d/next/Library/2021-03-11-00-31-41.bpo-42967.2PeQRw.rst
Diffstat (limited to 'Lib/test/test_urlparse.py')
-rw-r--r-- | Lib/test/test_urlparse.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index 3b1c360..c543ac9 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -893,6 +893,8 @@ class UrlParseTestCase(unittest.TestCase): with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"): result = urllib.parse.parse_qs(orig, separator=';') self.assertEqual(result, expect, "Error parsing %r" % orig) + result_bytes = urllib.parse.parse_qs(orig, separator=b';') + self.assertEqual(result_bytes, expect, "Error parsing %r" % orig) def test_parse_qsl_separator(self): @@ -912,6 +914,8 @@ class UrlParseTestCase(unittest.TestCase): with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"): result = urllib.parse.parse_qsl(orig, separator=';') self.assertEqual(result, expect, "Error parsing %r" % orig) + result_bytes = urllib.parse.parse_qsl(orig, separator=b';') + self.assertEqual(result_bytes, expect, "Error parsing %r" % orig) def test_urlencode_sequences(self): |