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
Stop using deprecated imp module; imp should now emit a real DeprecationWarning #69347
Comments
The imp module is deprecated since Python 3.4. In Python 3.4, imp uses a PendingDeprecationWarning, and Python 3.5... hum, still a PendingDeprecationWarning. It was not supposed to become a real DeprecationWarning? Anyway, the imp module is still used in some places of the Python stdlib: Lib/modulefinder.py:14: import imp modulefinder explicitly ignore the warning :-( with warnings.catch_warnings():
warnings.simplefilter('ignore', PendingDeprecationWarning)
import imp |
See bpo-20021. |
New changeset 03cd8340e0ce by Victor Stinner in branch '3.5': |
I forgot to link bpo-20020 in my earlier message :) |
I opened the issue bpo-26639 for it.
I pushed the change f682b620c64d but I forgot about the issue bpo-20021. Let's discuss there about this script.
I think that it's fine to keep imp there.
This one requires more work than the other. |
Current status:
I'll work on replacing some of these. |
One more:
|
There is an already open issue for this: bpo-21446. |
Fixed for Python 3.8 via the patch for bpo-35936. |
Oops, this covers more than just modulefinder - reopening until the other remaining uses of the imp module have been removed. |
Any reason to keep imp there? We can just port it to sole importlib (it already uses it in some places) |
Nope, not anymore. |
Make sure the standard library doesn't emit those warnings itself. |
I meant to comment on a different issue, the trigger is stuff like https://bugs.python.org/issue39015 (new deprecationwarnings being generated without cleaning up the standard library first). |
imp has been moved to DeprecationWarning and I think its usage in the stdlib has been dealt with at this point. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: