mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
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
This commit is contained in:
parent
63bf1abfdc
commit
b38601d496
3 changed files with 8 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue