mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
gh-116764: Fix regressions in urllib.parse.parse_qsl() (GH-116801)
* Restore support of None and other false values.
* Raise TypeError for non-zero integers and non-empty sequences.
The regressions were introduced in gh-74668
(bdba8ef42b
).
This commit is contained in:
parent
269051d20e
commit
1069a462f6
3 changed files with 33 additions and 1 deletions
|
@ -773,7 +773,11 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
|
|||
def _unquote(s):
|
||||
return unquote_plus(s, encoding=encoding, errors=errors)
|
||||
else:
|
||||
qs = bytes(qs)
|
||||
if not qs:
|
||||
return []
|
||||
# Use memoryview() to reject integers and iterables,
|
||||
# acceptable by the bytes constructor.
|
||||
qs = bytes(memoryview(qs))
|
||||
if isinstance(separator, str):
|
||||
separator = bytes(separator, 'ascii')
|
||||
eq = b'='
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue