Issue25160
Created on 2015-09-18 07:06 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue25160-2to3.patch | JelleZijlstra, 2016-06-02 19:21 | patch for lib2to3 | review | |
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11787 | merged | brandtbucher, 2019-02-08 03:24 | |
| PR 11787 | merged | brandtbucher, 2019-02-08 03:24 | |
| Messages (15) | |||
|---|---|---|---|
| msg250946 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2015-09-18 07:06 | |
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 Python/makeopcodetargets.py:9:import imp Tools/i18n/pygettext.py:159:import imp Tools/importbench/importbench.py:10:import imp modulefinder explicitly ignore the warning :-( with warnings.catch_warnings(): warnings.simplefilter('ignore', PendingDeprecationWarning) import imp |
|||
| msg250948 - (view) | Author: Berker Peksag (berker.peksag) * ![]() |
Date: 2015-09-18 07:11 | |
> Python/makeopcodetargets.py:9:import imp See issue 20021. |
|||
| msg250949 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2015-09-18 07:12 | |
New changeset 03cd8340e0ce by Victor Stinner in branch '3.5': Issue #25160: Fix import_init() comments and messages https://hg.python.org/cpython/rev/03cd8340e0ce |
|||
| msg250950 - (view) | Author: Berker Peksag (berker.peksag) * ![]() |
Date: 2015-09-18 07:19 | |
> Lib/modulefinder.py:14: import imp I forgot to link issue 20020 in my earlier message :) |
|||
| msg262467 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2016-03-25 23:36 | |
> Tools/i18n/pygettext.py:159:import imp I opened the issue #26639 for it. >> Python/makeopcodetargets.py:9:import imp > See issue 20021. I pushed the change f682b620c64d but I forgot about the issue #20021. Let's discuss there about this script. > Tools/importbench/importbench.py:10:import imp I think that it's fine to keep imp there. > Lib/modulefinder.py:14: import imp This one requires more work than the other. |
|||
| msg266914 - (view) | Author: Jelle Zijlstra (JelleZijlstra) * ![]() |
Date: 2016-06-02 18:59 | |
Current status: - 2to3 replaces reload() calls with imp.reload - Lib/modulefinder.py imports imp and uses it 10 or so times, mostly for constants - Lib/xml/sax/__init__.py uses imp on Jython only - Python/makeopcodetargets.py falls back to imp if importlib is not available. - Tools/importbench/importbench.py uses imp a number of times. I'll work on replacing some of these. |
|||
| msg266929 - (view) | Author: Jelle Zijlstra (JelleZijlstra) * ![]() |
Date: 2016-06-02 19:25 | |
One more: - lib/pkgutil.py in _import_imp (amusingly) uses importlib with silenced warnings to import imp. |
|||
| msg266931 - (view) | Author: Berker Peksag (berker.peksag) * ![]() |
Date: 2016-06-02 19:28 | |
> - 2to3 replaces reload() calls with imp.reload There is an already open issue for this: Issue 21446. |
|||
| msg339564 - (view) | Author: Alyssa Coghlan (ncoghlan) * ![]() |
Date: 2019-04-07 08:07 | |
Fixed for Python 3.8 via the patch for #35936. |
|||
| msg339565 - (view) | Author: Alyssa Coghlan (ncoghlan) * ![]() |
Date: 2019-04-07 08:09 | |
Oops, this covers more than just modulefinder - reopening until the other remaining uses of the imp module have been removed. |
|||
| msg357975 - (view) | Author: Batuhan Taskaya (BTaskaya) * ![]() |
Date: 2019-12-07 13:31 | |
@vstinner > Tools/importbench/importbench.py:10:import imp > I think that it's fine to keep imp there. Any reason to keep imp there? We can just port it to sole importlib (it already uses it in some places) |
|||
| msg358127 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2019-12-09 18:55 | |
> Any reason to keep imp there? Nope, not anymore. |
|||
| msg358194 - (view) | Author: Łukasz Langa (lukasz.langa) * ![]() |
Date: 2019-12-10 14:57 | |
Make sure the standard library doesn't emit those warnings itself. |
|||
| msg358196 - (view) | Author: Łukasz Langa (lukasz.langa) * ![]() |
Date: 2019-12-10 15:04 | |
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). |
|||
| msg370778 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2020-06-05 18:36 | |
imp has been moved to DeprecationWarning and I think its usage in the stdlib has been dealt with at this point. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:21 | admin | set | github: 69347 |
| 2020-06-05 18:36:26 | brett.cannon | set | status: open -> closed resolution: fixed messages: + msg370778 stage: needs patch -> resolved |
| 2019-12-10 15:04:06 | lukasz.langa | set | messages: + msg358196 |
| 2019-12-10 14:57:12 | lukasz.langa | set | nosy:
+ lukasz.langa messages: + msg358194 |
| 2019-12-09 18:55:38 | brett.cannon | set | messages: + msg358127 |
| 2019-12-07 13:31:59 | BTaskaya | set | nosy:
+ BTaskaya messages: + msg357975 |
| 2019-04-07 08:09:12 | ncoghlan | set | status: closed -> open resolution: fixed -> (no value) messages: + msg339565 stage: resolved -> needs patch |
| 2019-04-07 08:07:41 | ncoghlan | set | status: open -> closed versions:
+ Python 3.8, - Python 3.6 messages:
+ msg339564 |
| 2019-02-08 03:24:25 | brandtbucher | set | stage: needs patch -> patch review pull_requests: + pull_request11787 |
| 2019-02-08 03:24:14 | brandtbucher | set | stage: needs patch -> needs patch pull_requests: + pull_request11786 |
| 2016-06-02 19:28:30 | berker.peksag | set | messages: + msg266931 |
| 2016-06-02 19:25:28 | JelleZijlstra | set | messages: + msg266929 |
| 2016-06-02 19:21:08 | JelleZijlstra | set | files:
+ issue25160-2to3.patch keywords: + patch |
| 2016-06-02 18:59:04 | JelleZijlstra | set | nosy:
+ JelleZijlstra messages: + msg266914 |
| 2016-03-25 23:36:50 | vstinner | set | nosy:
+ eric.snow |
| 2016-03-25 23:36:33 | vstinner | set | messages: + msg262467 |
| 2015-10-04 02:13:41 | Arfrever | set | nosy:
+ Arfrever |
| 2015-09-18 07:19:24 | berker.peksag | set | messages: + msg250950 |
| 2015-09-18 07:12:35 | python-dev | set | nosy:
+ python-dev messages: + msg250949 |
| 2015-09-18 07:11:52 | berker.peksag | set | type: enhancement components: + Library (Lib) versions: - Python 3.5 nosy: + berker.peksag messages:
+ msg250948 |
| 2015-09-18 07:06:19 | vstinner | create | |

