pyflakes stacktrace: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Bug #1580214 reported by Scott Moser
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pyflakes (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

$ cat x/__init__.py
def greet(name):
    print("Hello, %s. Happy to see you." % name)

$ cat x/welcome.py
from . import greet

if __name__ == '__main__':
    import sys
    greet(sys.argv[1])

# python -m x.welcome Scott
Hello, Scott. Happy to see you.

# python3 -m x.welcome Scott
Hello, Scott. Happy to see you.

# python -m pyflakes x/
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/pyflakes/__main__.py", line 5, in <module>
    main(prog='pyflakes')
  File "/usr/lib/python2.7/dist-packages/pyflakes/api.py", line 184, in main
    warnings = checkRecursive(args, reporter)
  File "/usr/lib/python2.7/dist-packages/pyflakes/api.py", line 141, in checkRecursive
    warnings += checkPath(sourcePath, reporter)
  File "/usr/lib/python2.7/dist-packages/pyflakes/api.py", line 108, in checkPath
    return check(codestr, filename, reporter)
  File "/usr/lib/python2.7/dist-packages/pyflakes/api.py", line 69, in check
    w = checker.Checker(tree, filename)
  File "/usr/lib/python2.7/dist-packages/pyflakes/checker.py", line 416, in __init__
    self.handleChildren(tree)
  File "/usr/lib/python2.7/dist-packages/pyflakes/checker.py", line 738, in handleChildren
    self.handleNode(node, tree)
  File "/usr/lib/python2.7/dist-packages/pyflakes/checker.py", line 785, in handleNode
    handler(node)
  File "/usr/lib/python2.7/dist-packages/pyflakes/checker.py", line 1164, in IMPORTFROM
    node.module, alias.name)
  File "/usr/lib/python2.7/dist-packages/pyflakes/checker.py", line 212, in __init__
    full_name = module + '.' + self.real_name
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: pyflakes 1.2.2-1
ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Tue May 10 14:29:53 2016
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
SourcePackage: pyflakes
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pyflakes (Ubuntu):
status: New → Confirmed
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.