urllib.parse.parse_qsl() and parse_qs() accept a strict_parsing keyword that, when True, raises ValueError on a malformed query field — one without a = separator, e.g. "a=1&b&c=3". This error branch is currently not exercised by Lib/test/test_urlparse.py: the existing parse_qsl/parse_qs tests only cover well-formed inputs and the default lenient behavior, so a regression that silently dropped the strict_parsing check would not be caught. It would be good to add a small test covering the strict_parsing=True branch for both functions on str and bytes inputs, alongside a well-formed control. Addressed by PR #154207.
Linked PRs
urllib.parse.parse_qsl()andparse_qs()accept astrict_parsingkeyword that, whenTrue, raisesValueErroron a malformed query field — one without a=separator, e.g."a=1&b&c=3". This error branch is currently not exercised byLib/test/test_urlparse.py: the existingparse_qsl/parse_qstests only cover well-formed inputs and the default lenient behavior, so a regression that silently dropped thestrict_parsingcheck would not be caught. It would be good to add a small test covering thestrict_parsing=Truebranch for both functions onstrandbytesinputs, alongside a well-formed control. Addressed by PR #154207.Linked PRs