This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author petr.viktorin
Recipients AdamGold, eric.araujo, gregory.p.smith, kj, lemburg, lukasz.langa, mcepl, ned.deily, orsenthil, petr.viktorin, rschiron, serhiy.storchaka, vstinner
Date 2021-03-10.13:51:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615384308.36.0.679815186598.issue42967@roundup.psfhosted.org>
In-reply-to
Content
With the fix, parse_qs[l] doesn't handle bytes separators correctly.
There is an explicit type check for str/bytes:

    if not separator or (not isinstance(separator, (str, bytes))):
        raise ValueError("Separator must be of type string or bytes.")

but a bytes separator fails further down:

>>> import urllib.parse
>>> urllib.parse.parse_qs('a=1,b=2', separator=b',')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pviktori/dev/cpython/Lib/urllib/parse.py", line 695, in parse_qs
    pairs = parse_qsl(qs, keep_blank_values, strict_parsing,
  File "/home/pviktori/dev/cpython/Lib/urllib/parse.py", line 748, in parse_qsl
    pairs = [s1 for s1 in qs.split(separator)]
TypeError: must be str or None, not bytes
History
Date User Action Args
2021-03-10 13:51:48petr.viktorinsetrecipients: + petr.viktorin, lemburg, gregory.p.smith, orsenthil, vstinner, ned.deily, mcepl, eric.araujo, lukasz.langa, serhiy.storchaka, rschiron, kj, AdamGold
2021-03-10 13:51:48petr.viktorinsetmessageid: <1615384308.36.0.679815186598.issue42967@roundup.psfhosted.org>
2021-03-10 13:51:48petr.viktorinlinkissue42967 messages
2021-03-10 13:51:48petr.viktorincreate