-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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-97850: Deprecate find_loader
and get_loader
in pkgutil
#98520
gh-97850: Deprecate find_loader
and get_loader
in pkgutil
#98520
Conversation
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.
Some comments and suggestions on the implementation of this deprecation, based on how we've handled others recently.
Pro tip (since not everyone seems to know this): if you go to the Files changed
tab of this PR, you can apply some or all of the suggestions in one click by clicking Add to batch
on each suggestion you want, and then click Commit
either at the top or on any added suggestion with a descriptive message.
Misc/NEWS.d/next/Library/2022-10-21-16-23-31.gh-issue-97850.N46coo.rst
Outdated
Show resolved
Hide resolved
…6coo.rst Co-authored-by: C.A.M. Gerlach <[email protected]>
Thank you for the reviews: @merwok and @CAM-Gerlach I've also checked that >>> import pkgutil
>>> pkgutil.get_loader('os')
<stdin>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14; use importlib.util.find_spec instead
<_frozen_importlib_external.SourceFileLoader object at 0x1012d55f0>
>>>
I've also merged one of the @CAM-Gerlach's suggestion, so you get a credit for your awesome proposals! 🤝 |
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.
Overall LGTM, but I think there might be some unnecessary checks in the tests for various module "kinds".
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 |
Just FYI, you can apply some or all of them at once by going to the |
…m/sobolevn/cpython into deprecate-pkgutil-get-find-loader
@brettcannon I forgot to send the magic phrase! 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. |
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.
Unfortunately I just realized that the documentation for pkgutil needs updating to mention the deprecations.
Misc/NEWS.d/next/Library/2022-10-21-16-23-31.gh-issue-97850.N46coo.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 |
Co-authored-by: Brett Cannon <[email protected]>
find_module
and get_module
in pkgutil
find_loader
and get_loader
in pkgutil
…6coo.rst Co-authored-by: Brett Cannon <[email protected]>
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. |
Oups, just found out that my push with Redid it now, it worked! |
@sobolevn the changes look good, but now there are unfortunately merge conflicts. |
Done :) |
Thanks! |
Thank you for this additional cleanup! |
Refs #64138