gh-142781: Fix type confusion in zoneinfo weak cache#142925
gh-142781: Fix type confusion in zoneinfo weak cache#142925encukou merged 9 commits intopython:mainfrom
Conversation
Validate the types returned from _weak_cache.get() and _weak_cache.setdefault() to prevent type confusion when a ZoneInfo subclass provides a misbehaving cache implementation.
Misc/NEWS.d/next/Library/2025-12-18-00-14-16.gh-issue-142781.gcOeYF.rst
Outdated
Show resolved
Hide resolved
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
…sage, rewriting NEWS and improving unit test
|
Thanks for the review! I have addressed all the comments above. Ready for another look. |
picnixz
left a comment
There was a problem hiding this comment.
You should update the branch as we ZoneInfo was modified recently.
Thanks for your advice! All comments are resolved. Let me know if anything else is needed! |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
Updating branch to fix the CI, it is currently incompatible. |
|
Thanks @superboy-zjc for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @superboy-zjc for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
GH-145418 is a backport of this pull request to the 3.13 branch. |
|
GH-145419 is a backport of this pull request to the 3.14 branch. |
Validate the types returned from
_weak_cache.get()and_weak_cache.setdefault()to prevent type confusion when a ZoneInfo subclass provides a misbehaving cache implementation.Fixes gh-142781.