Title: Deprecate support of false values in urllib.parse.parse_qsl() · Issue #116897 · python/cpython · GitHub
Open Graph Title: Deprecate support of false values in urllib.parse.parse_qsl() · Issue #116897 · python/cpython
X Title: Deprecate support of false values in urllib.parse.parse_qsl() · Issue #116897 · python/cpython
Description: urllib.parse.parse_qsl() returns [] for any false value. There were no tests for this, so it was broken by accident in #115771 and restored in #116764. Historically, the special case was needed to circumvent the fact that ''.split('&') r...
Open Graph Description: urllib.parse.parse_qsl() returns [] for any false value. There were no tests for this, so it was broken by accident in #115771 and restored in #116764. Historically, the special case was needed to ...
X Description: urllib.parse.parse_qsl() returns [] for any false value. There were no tests for this, so it was broken by accident in #115771 and restored in #116764. Historically, the special case was needed to ...
Opengraph URL: https://github.com/python/cpython/issues/116897
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deprecate support of false values in urllib.parse.parse_qsl()","articleBody":"`urllib.parse.parse_qsl()` returns `[]` for any false value. There were no tests for this, so it was broken by accident in #115771 and restored in #116764.\r\n\r\nHistorically, the special case was needed to circumvent the fact that `''.split('\u0026')` returns `['']` instead of `[]`. `parse_qsl('')` and `parse_qsl(b'')` should return `[]`. But zero numbers and empty sequences (like `parse_qsl(0)` and `parse_qsl([])`) should be errors. So I propose to deprecate the current behavior for general false values and make them errors in future.\r\n\r\nThere is an open question about None. There is a code in the wild that expects `parse_qsl(None)` to work. Although it is not difficult to add workarounds for this, it may be more convenient if `None` is accepted as a valid value.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-116903\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2024-03-16T10:59:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/116897/cpython/issues/116897"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c4170a8c-388c-d47b-79f4-fb0514ac8176 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA40:19F979:238C139:325F557:6A4CE1AD |
| html-safe-nonce | 5fa14b4026b127c242da55c8d8c205a1dffa514208d9529b5283ddc1713db4fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTQwOjE5Rjk3OToyMzhDMTM5OjMyNUY1NTc6NkE0Q0UxQUQiLCJ2aXNpdG9yX2lkIjoiMTA0NzU3ODkyMDgzMDY4OTcwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | af8a7fbedd9175a399522d452ab997ef4776b55c3529dba4990d85d5c9ef76fd |
| hovercard-subject-tag | issue:2189912513 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/116897/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f516d7939257ec37c23136fdebe453b90870ae20cb9d8c4b9b7dd90c5232a46/python/cpython/issues/116897 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f516d7939257ec37c23136fdebe453b90870ae20cb9d8c4b9b7dd90c5232a46/python/cpython/issues/116897 |
| og:image:alt | urllib.parse.parse_qsl() returns [] for any false value. There were no tests for this, so it was broken by accident in #115771 and restored in #116764. Historically, the special case was needed to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c5a57f04eeb310f57c73fd6d751d957e2ca27ed2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width