Message388433
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 |
|
Date |
User |
Action |
Args |
2021-03-10 13:51:48 | petr.viktorin | set | recipients:
+ 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:48 | petr.viktorin | set | messageid: <1615384308.36.0.679815186598.issue42967@roundup.psfhosted.org> |
2021-03-10 13:51:48 | petr.viktorin | link | issue42967 messages |
2021-03-10 13:51:48 | petr.viktorin | create | |
|