-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Regression in urllib.parse.parse_qsl(None)
behavior
#116764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@serhiy-storchaka If there's agreement that the old behavior when passing |
* Restore support of None and other false values (fix regression introduced in pythongh-74668). * Raise TypeError for non-zero integers and non-empty sequences.
Thank you for your report @msullivan. This looks as a serious reason to restore support of false values, even if it was not intentional behavior. I already started to write a PR when I requested for creating this issue. The fix was trivial, but there was substantial lack of tests, and new tests exposed other flaws in this code, so the final code is more complicated. |
…H-116801) * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in pythongh-74668 (bdba8ef). (cherry picked from commit 1069a46) Co-authored-by: Serhiy Storchaka <[email protected]>
…H-116801) * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in pythongh-74668 (bdba8ef). (cherry picked from commit 1069a46) Co-authored-by: Serhiy Storchaka <[email protected]>
) (GH-116894) * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in gh-74668 (bdba8ef). (cherry picked from commit 1069a46) Co-authored-by: Serhiy Storchaka <[email protected]>
Opened #116897 for deprecating support of generic false values. |
) (GH-116895) * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in gh-74668 (bdba8ef). (cherry picked from commit 1069a46) Co-authored-by: Serhiy Storchaka <[email protected]>
…H-116801) * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in pythongh-74668 (bdba8ef).
…H-116801) * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in pythongh-74668 (bdba8ef).
…H-116801) * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in pythongh-74668 (bdba8ef).
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
#115771 introduced a change in some currently working behavior. Previously:
but now it raises
TypeError: cannot convert 'NoneType' object to bytes
.(
parse_qs
also broke, since it callsparse_qsl
)I think it's obviously pretty debatable whether the old behavior was desirable but there is popular code in the wild that depends on it: https://github.com/encode/httpx/blob/7df47ce4d93a06f2c3310cd692b4c2336d7663ba/httpx/_urls.py#L431-L433.
(I stumbled across this when one of my colleagues was accidentally using a current dev branch of 3.11 and started getting mysterious errors from inside the bowels of the httpx client.)
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: