bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (GH… · python/cpython@d5b80eb · GitHub
Skip to content

Commit d5b80eb

Browse files
bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (GH-24818) (#25345)
* coerce bytes separator to string * Add news * Update Misc/NEWS.d/next/Library/2021-03-11-00-31-41.bpo-42967.2PeQRw.rst (cherry picked from commit b38601d) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
1 parent 816da33 commit d5b80eb

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/test/test_urlparse.py

Lines changed: 4 additions & 0 deletions

Lib/urllib/parse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
721721
Returns a list, as G-d intended.
722722
"""
723723
qs, _coerce_result = _coerce_args(qs)
724+
separator, _ = _coerce_args(separator)
724725

725726
if not separator or (not isinstance(separator, (str, bytes))):
726727
raise ValueError("Separator must be of type string or bytes.")
Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)