classification
Title: ModuleFinder does not resolve ".." correctly
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: mkleehammer
Priority: normal Keywords:

Created on 2019-08-09 00:02 by mkleehammer, last changed 2019-08-09 00:02 by mkleehammer.

Files
File name Uploaded Description Edit
test.tar.gz mkleehammer, 2019-08-09 00:02 test case
Messages (1)
msg349268 - (view) Author: Michael Kleehammer (mkleehammer) * Date: 2019-08-09 00:02
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.
History
Date User Action Args
2019-08-09 00:02:55mkleehammercreate