mirror of
https://github.com/python/cpython.git
synced 2025-08-16 23:01:34 +00:00
[3.12] gh-116764: Fix regressions in urllib.parse.parse_qsl() (GH-116801) (GH-116894)
* 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
). (cherry picked from commit1069a462f6
) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
32c775165f
commit
716d482ba4
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