This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Update reload fixer to use importlib instead of imp
Type: enhancement Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: JelleZijlstra, benjamin.peterson, berker.peksag, brett.cannon
Priority: normal Keywords: patch

Created on 2014-05-06 09:51 by berker.peksag, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
reload-fixer.diff berker.peksag, 2014-05-06 09:51 review
Pull Requests
URL Status Linked Edit
PR 8391 merged berker.peksag, 2018-07-22 06:13
PR 8404 merged miss-islington, 2018-07-23 06:49
Messages (9)
msg217973 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-05-06 09:51
Since imp.reload() was deprecated in issue 18193, the reload fixer (added in issue 11797) needs to be updated to use importlib.reload() instead of imp.reload().
msg217987 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-05-06 14:24
I don't think that's necessarily obvious since that will make your code tied to Python 3.4.
msg266951 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2016-06-02 21:07
I couldn't find references in the docs to clarify what version of 3.x 2to3 targets, but it seems reasonable to me that it produces code targeted to the version of CPython it was bundled with. imp is deprecated and presumably will be removed later in 3.x, so it's better not to migrate people's Python 2 code to use it.
msg321609 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-07-13 13:32
Brett, what do you think about this issue since Python 3.4 is pretty old now. Should I convert my patch to GitHub PR or close this issue as 'wontfix'?
msg321630 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2018-07-13 19:28
I would still fix it as I suspect there will be a burst of users of this come 2020 and at this point it won't be a compatibility issue going forward since 3.4 is so old. :)
msg322133 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-07-22 06:22
Thanks, Brett. I've opened PR 8391. Should we backport this to 3.7? We do backport mimetypes additions (see https://github.com/python/cpython/commit/8204b903683f9e0f037ccfaa87622716019914d7 for an example) I think lib2to3 falls into the same category as mimetypes and it might be better to keep fixers in sync at least in 3.7 and 3.8.
msg322151 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2018-07-22 16:37
I think we said backporting fixers was fine but I honestly don't remember.

On Sat, Jul 21, 2018, 23:22 Berker Peksag, <report@bugs.python.org> wrote:

>
> Berker Peksag <berker.peksag@gmail.com> added the comment:
>
> Thanks, Brett. I've opened PR 8391. Should we backport this to 3.7? We do
> backport mimetypes additions (see
> https://github.com/python/cpython/commit/8204b903683f9e0f037ccfaa87622716019914d7
> for an example) I think lib2to3 falls into the same category as mimetypes
> and it might be better to keep fixers in sync at least in 3.7 and 3.8.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue21446>
> _______________________________________
>
msg322182 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-07-23 06:49
New changeset 7a3056fa7dd1223fe7112e53b236c43d71f33f64 by Berker Peksag in branch 'master':
bpo-21446: Update reload fixer to use importlib (GH-8391)
https://github.com/python/cpython/commit/7a3056fa7dd1223fe7112e53b236c43d71f33f64
msg322186 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-07-23 08:11
New changeset 05a72f15f76301c505a91728f0818b421fddd290 by Berker Peksag (Miss Islington (bot)) in branch '3.7':
bpo-21446: Update reload fixer to use importlib (GH-8391)
https://github.com/python/cpython/commit/05a72f15f76301c505a91728f0818b421fddd290
History
Date User Action Args
2022-04-11 14:58:03adminsetgithub: 65645
2018-12-29 02:54:45terry.reedylinkissue35570 superseder
2018-07-23 08:11:50berker.peksagsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-07-23 08:11:33berker.peksagsetmessages: + msg322186
2018-07-23 06:49:22miss-islingtonsetpull_requests: + pull_request7930
2018-07-23 06:49:11berker.peksagsetmessages: + msg322182
2018-07-23 05:36:07berker.peksagsetversions: + Python 3.7
2018-07-22 16:37:43brett.cannonsetmessages: + msg322151
2018-07-22 06:22:16berker.peksagsetmessages: + msg322133
2018-07-22 06:13:58berker.peksagsetpull_requests: + pull_request7919
2018-07-13 19:28:10brett.cannonsetmessages: + msg321630
2018-07-13 13:32:36berker.peksagsettype: enhancement
messages: + msg321609
versions: + Python 3.8, - Python 3.5
2016-06-02 21:07:40JelleZijlstrasetnosy: + JelleZijlstra
messages: + msg266951
2014-05-06 14:24:18brett.cannonsetmessages: + msg217987
2014-05-06 09:51:39berker.peksagcreate