-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-121604: Make sure all deprecated items in importlib raise DeprecationWarning #128007
Conversation
Co-authored-by: rashansmith <[email protected]>
Co-authored-by: rashansmith <[email protected]>
…CODE_SUFFIXES. Co-authored-by: rashansmith <[email protected]>
Co-authored-by: rashansmith <[email protected]>
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.
Two little things I noticed. I did not have time to go through the rest but it looks good in general.
Co-authored-by: Stan Ulbrych <[email protected]>
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 |
Sorry about the review delay! |
No worries, and thanks for the review! I think I addressed your comments if you feel like having another look :) I have made the requested changes; please review again |
Thanks for making the requested changes! @brettcannon: please review the changes made to this pull request. |
Misc/NEWS.d/next/Library/2024-12-16-22-20-38.gh-issue-121604.m3Xn4G.rst
Outdated
Show resolved
Hide resolved
Thanks, @tomasr8 for bearing with me and my delayed reviews! 😅 |
No worries :) Thanks for the review! |
import warnings | ||
warnings.warn('importlib.abc.ResourceLoader is deprecated in ' | ||
'favour of supporting resource loading through ' | ||
'importlib.resources.abc.ResourceReader.', |
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.
ResourceReader is deprecated in favour of Superseded by TraversableResources
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.
Nice catch! I added this in another PR recently and forgot to update it here. I'll fix this later today if you don't beat me to it ;)
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.
ah I opened a PR
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.
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.
Thanks! Though, part of that is already covered by #128601
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.
Ah ok hmm, I'm afk for a while so I'm happy for my PR to be closed to make way for a narrower PR to fix just this issue and a followup for the wider change?
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.
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.
Ah ok hmm, I'm afk for a while so I'm happy for my PR to be closed to make way for a narrower PR to fix just this issue and a followup for the wider change?
I'm on my phone ATM so it's harder to check, but my PR only addresses the docs, not the deprecation message, so you don't need to close yours (just maybe keep only the message change) :)
Largely based on work done by @rashansmith, this adds deprecation warnings for the following importlib classes, methods and attributes (using the docs as the source of truth):
The deprecation messages are based on the docs. Warnings for
DEBUG_BYTECODE_SUFFIXES
andOPTIMIZED_BYTECODE_SUFFIXES
are implemented using a module__getattr__
.Feedback welcome!
DeprecationWarning
#121604