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

ModuleFinder does not resolve ".." correctly #81977

Open
mkleehammer mannequin opened this issue Aug 9, 2019 · 1 comment
Open

ModuleFinder does not resolve ".." correctly #81977

mkleehammer mannequin opened this issue Aug 9, 2019 · 1 comment
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@mkleehammer
Copy link
Mannequin

mkleehammer mannequin commented Aug 9, 2019

BPO 37796
Nosy @mkleehammer
Files
  • test.tar.gz: test case
  • 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 = None
    created_at = <Date 2019-08-09.00:02:55.522>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'ModuleFinder does not resolve ".." correctly'
    updated_at = <Date 2019-08-09.00:02:55.522>
    user = 'https://github.com/mkleehammer'

    bugs.python.org fields:

    activity = <Date 2019-08-09.00:02:55.522>
    actor = 'mkleehammer'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2019-08-09.00:02:55.522>
    creator = 'mkleehammer'
    dependencies = []
    files = ['48535']
    hgrepos = []
    issue_num = 37796
    keywords = []
    message_count = 1.0
    messages = ['349268']
    nosy_count = 1.0
    nosy_names = ['mkleehammer']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37796'
    versions = ['Python 3.7', 'Python 3.8']

    @mkleehammer
    Copy link
    Mannequin Author

    mkleehammer mannequin commented Aug 9, 2019

    The modulefinder module does not handle relative directories properly. The error I found is when one subpackage attempts to import from a sibling subpackage using the form

    from ..language import (
        DirectiveDefinitionNode,
        ...
    )
    

    In this example, it would report "language.DirectiveDefinitionNode" is missing.

    It correctly resolves the names when importing modules, but when an import fails because it is a variable or function, it records the name incorrectly and cannot filter it out later.

    I've attached a small test case and there is a README describing the test and results.

    @mkleehammer mkleehammer mannequin added 3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Aug 9, 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.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants