-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
bpo-44002: Switch to lru_cache in urllib.parse. #25798
Conversation
urllib.parse now uses functool.lru_cache for its internal URL splitting and quoting caches instead of rolling its own like its the 90s. The undocumented internal Quoted class and clear_cache() APIs are now deprecated, for removal in 3.14.
I won't merge this until after the 3.10 branch is cut and all of the https://bugs.python.org/issue43882 fixes are in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test that's failing due to an unexpected BytesWarning in CI is annoying... that means we need to use lru_cache(typed=True)
on the urlsplit decorator for safety to avoid other people who enable BytesWarning from seeing that warning.
It looks like the Travis CI failed only because of excess whitespace. Running 'make patchcheck' would likely clear it. |
This final change, which addressed the review comments from the reviewers looks good to me. |
twisted, gevent, and our own libregrtest use it in test suites. We'll keep it for them. ... and skip Pending on Quoter's DeprecationWarning. No uses of that have been found externally. Also reoragnizes the unittest a bit to be cleaner and fixes a whitespace problem.
Status: awaiting a copy of #25853 to be merged into |
@gpshead: Status check is done, and it's a failure ❌ . |
@gpshead: Status check is done, and it's a success ❌ . |
Excellent change. @gpshead :) |
urllib.parse now uses functool.lru_cache for its internal URL splitting and
quoting caches instead of rolling its own like its the 90s.
The undocumented internal Quoted class is now deprecated, for removal in 3.14.
No existing users were found.
clear_cache() is kept as twisted, gevent, and our own regression test runner were
found to be using it in their test suites.
https://bugs.python.org/issue44002
Automerge-Triggered-By: GH:gpshead