Missing import warnings when importing fully-qualified modules

Bug #1421013 reported by Greg Ward
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyflakes
Confirmed
Low
Unassigned

Bug Description

Importing modules using fully-qualified paths appears to confuse pyflakes. Example #1:

'''
$ cat pyflakes-missed-unused-import.py
import somepackage.mod1
import somepackage.mod2

def do_something():
    somepackage.mod1.do_something()

$ pyflakes pyflakes-missed-unused-import.py
'''

Expected output: an "unused import" warning about somepackage.mod2.

Actual output: no errors or warnings.

Example #2:

'''
$ cat pyflakes-missed-missing-import.py
import somepackage.mod2

def do_something():
    somepackage.mod1.do_something()

$ pyflakes pyflakes-missed-missing-import.py
'''

Expected output: a "missing import" error about somepackage.mod1 *and* an "unused import" warning about somepackage.mod2.

Actual output: no errors or warnings.

Revision history for this message
Phil Frost (bitglue) wrote :

Indeed, this is an issue. Fixing it will require some substantial rework of Pyflakes' data model, because currently it doesn't know anything about attributes.

Changed in pyflakes:
status: New → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.