Skip to content
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

Update reload fixer to use importlib instead of imp #65645

Closed
berkerpeksag opened this issue May 6, 2014 · 9 comments
Closed

Update reload fixer to use importlib instead of imp #65645

berkerpeksag opened this issue May 6, 2014 · 9 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life topic-2to3 type-feature A feature request or enhancement

Comments

@berkerpeksag
Copy link
Member

BPO 21446
Nosy @brettcannon, @benjaminp, @berkerpeksag, @JelleZijlstra
PRs
  • bpo-21446: Update reload fixer to use importlib #8391
  • [3.7] bpo-21446: Update reload fixer to use importlib (GH-8391) #8404
  • Files
  • reload-fixer.diff
  • 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:

    assignee = None
    closed_at = <Date 2018-07-23.08:11:50.550>
    created_at = <Date 2014-05-06.09:51:39.916>
    labels = ['3.7', '3.8', 'type-feature', 'expert-2to3']
    title = 'Update reload fixer to use importlib instead of imp'
    updated_at = <Date 2018-07-23.08:11:50.550>
    user = 'https://github.com/berkerpeksag'

    bugs.python.org fields:

    activity = <Date 2018-07-23.08:11:50.550>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-23.08:11:50.550>
    closer = 'berker.peksag'
    components = ['2to3 (2.x to 3.x conversion tool)']
    creation = <Date 2014-05-06.09:51:39.916>
    creator = 'berker.peksag'
    dependencies = []
    files = ['35161']
    hgrepos = []
    issue_num = 21446
    keywords = ['patch']
    message_count = 9.0
    messages = ['217973', '217987', '266951', '321609', '321630', '322133', '322151', '322182', '322186']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'benjamin.peterson', 'berker.peksag', 'JelleZijlstra']
    pr_nums = ['8391', '8404']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21446'
    versions = ['Python 3.7', 'Python 3.8']

    @berkerpeksag
    Copy link
    Member Author

    Since imp.reload() was deprecated in bpo-18193, the reload fixer (added in bpo-11797) needs to be updated to use importlib.reload() instead of imp.reload().

    @brettcannon
    Copy link
    Member

    I don't think that's necessarily obvious since that will make your code tied to Python 3.4.

    @JelleZijlstra
    Copy link
    Member

    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.

    @berkerpeksag
    Copy link
    Member Author

    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'?

    @berkerpeksag berkerpeksag added 3.8 (EOL) end of life type-feature A feature request or enhancement labels Jul 13, 2018
    @brettcannon
    Copy link
    Member

    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. :)

    @berkerpeksag
    Copy link
    Member Author

    Thanks, Brett. I've opened PR 8391. Should we backport this to 3.7? We do backport mimetypes additions (see 8204b90 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.

    @brettcannon
    Copy link
    Member

    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
    8204b90
    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\>


    @berkerpeksag berkerpeksag added the 3.7 (EOL) end of life label Jul 23, 2018
    @berkerpeksag
    Copy link
    Member Author

    New changeset 7a3056f by Berker Peksag in branch 'master':
    bpo-21446: Update reload fixer to use importlib (GH-8391)
    7a3056f

    @berkerpeksag
    Copy link
    Member Author

    New changeset 05a72f1 by Berker Peksag (Miss Islington (bot)) in branch '3.7':
    bpo-21446: Update reload fixer to use importlib (GH-8391)
    05a72f1

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 (EOL) end of life topic-2to3 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants