Open
Description
Bug report
Bug description:
urllib.parse.parse_qsl will happily parse a query string containing '#'.
from urllib.parse import parse_qsl
parse_qsl('foo=#', strict_parsing=True)
Output is [('foo', '#')]
.
But 'foo=#' is an invalid query string according to RFC 3986. Similarly, '[', and ']' are excluded from the set of valid query characters, but parse_qsl parses strings like 'foo=[' and 'foo=]' . In the absence of any allocation of responsibility, this looks like a bug to me.
CPython versions tested on:
3.13
Operating systems tested on:
macOS