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

Give modulefinder some much-needed updates. #80117

Closed
brandtbucher opened this issue Feb 8, 2019 · 4 comments
Closed

Give modulefinder some much-needed updates. #80117

brandtbucher opened this issue Feb 8, 2019 · 4 comments
Labels
3.8 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@brandtbucher
Copy link
Member

BPO 35936
Nosy @warsaw, @brettcannon, @ncoghlan, @brandtbucher
PRs
  • bpo-35936: Updates to modulefinder #11787
  • bpo-35936: Updates to modulefinder #11787
  • 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 2019-04-07.08:03:40.400>
    created_at = <Date 2019-02-08.03:13:18.904>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Give modulefinder some much-needed updates.'
    updated_at = <Date 2019-04-07.08:03:40.399>
    user = 'https://github.com/brandtbucher'

    bugs.python.org fields:

    activity = <Date 2019-04-07.08:03:40.399>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-04-07.08:03:40.400>
    closer = 'ncoghlan'
    components = ['Library (Lib)']
    creation = <Date 2019-02-08.03:13:18.904>
    creator = 'brandtbucher'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35936
    keywords = ['patch', 'patch']
    message_count = 4.0
    messages = ['335054', '335171', '339560', '339561']
    nosy_count = 5.0
    nosy_names = ['barry', 'brett.cannon', 'jvr', 'ncoghlan', 'brandtbucher']
    pr_nums = ['11787', '11787']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35936'
    versions = ['Python 3.8']

    @brandtbucher brandtbucher added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 8, 2019
    @brandtbucher
    Copy link
    Member Author

    I've written a patch here that includes a few useful fixes. Namely:

    • It doesn't crash if it encounters a syntax error. (17396)
    • It doesn't report certain name collisions as bad. (35376)
    • It doesn't use mutable default arguments in its initializer.
    • Most importantly, it now uses importlib instead of imp, which is deprecated. (25160) As a benefit, frozen built-in modules (zip import, for example), are now correctly reported.

    With the exception of these bug fixes, I've been very careful to preserve the original behavior, and have not changed any part of the API. This patch also includes 2 new regression tests.

    @brandtbucher brandtbucher added the 3.8 (EOL) end of life label Feb 8, 2019
    @brandtbucher
    Copy link
    Member Author

    Alright, I've gotten all of the tests passing for the new importlib-only implementation. I broke these modifications out into a new private function, _find_module, to make it clear that this fix is a simple drop-in replacement for imp.find_module.

    Let me know if there's anything I've missed or could improve. Otherwise, I feel my work here is done!

    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented Apr 7, 2019

    New changeset 9d7b2c0 by Nick Coghlan (Brandt Bucher) in branch 'master':
    bpo-35936: Updates to modulefinder (GH-11787)
    9d7b2c0

    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented Apr 7, 2019

    Thanks Brandt!

    I'll also go back and close bpo-17396, bpo-35376, and bpo-25160

    @ncoghlan ncoghlan closed this as completed Apr 7, 2019
    @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.8 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants