gh-63293: Deprecate providing false values besides strings, bytes, or None to urllib.parse functions#26687
gh-63293: Deprecate providing false values besides strings, bytes, or None to urllib.parse functions#26687jacobtylerwalls wants to merge 11 commits into
None to urllib.parse functions#26687Conversation
|
I just did a bpo search for duplicates and found bpo-22234. The discussion eventually came round to a similar solution after discussing the necessity of a deprecation period (believe the consensus = not needed). But in looking at the discussion there I realized it's safe to extend this solution to the other functions in the module and just factor this TypeError out to |
|
The failing test is caused by https://github.com/pypa/pip/blob/main/src/pip/_internal/models/link.py#L150-L154 I'll raise a PR against pip. So this may need to wait, unless we add a friendly shim. Notice that the other patch in bpo-22234 explicitly regarded this as an error condition: Update: |
This comment was marked as outdated.
This comment was marked as outdated.
|
This PR is stale because it has been open for 30 days with no activity. |
f156d42 to
d2f1bb9
Compare
|
From the failing docs job, I see |
|
@orsenthil I'm wondering if you have a view as a maintainer of Previously, values other than strings or bytes either failed cryptically with Is this a useful cleanup? I included a deprecation path for the falsy values. |
|
This PR is stale because it has been open for 30 days with no activity. |
…or inappropriate types
57464b3 to
c83d003
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Documentation build overview
271 files changed ·
|
None to urllib.parse functions
bpo-19094 and bpo-22234
Like a recent change in
parse_qsl()(#116903) to require strings, bytes, orNone, require this in otherurllib.parsefunctions as well, with a deprecation cycle for false values.Previously, although truthy values failed with
AttributeError: ... has no attribute 'decode', falsy values such as[]were silently accepted.Original patch by @vajrasky.
I noticed in 3.11 (d597fdc) some inappropriate types will fail first in
urlsplit()(only) via the@functools.lru_cachedecorator requiring hashable types. This is the chief reason for rotating unsupported types in the test cases.https://bugs.python.org/issue19094
Closes #63293
Closes #66430