logilab-astng #70497 Crash on AttributeError: 'NoneType' object has no attribute '_infer_name' [validation pending]

When running pylint 0.21.1 in combination with logilab-astng 0.20.1 and logilab-common 0.50.3 on the following code using python 2.5.1:

def f(): return
def g(p): return p
def h(): i = f(); j = g(i); j.a

logilab-astng crashes with the following exception:

Traceback (most recent call last):
 File "/tmp/pylint-0.21.1/bin/pylint", line 4, in <module>
   lint.Run(sys.argv[1:])
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/lint.py", line 848, in __init__
   linter.check(args)
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/lint.py", line 482, in check
   self.check_astng_module(astng, walker, rawcheckers)
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/lint.py", line 555, in check_astng_module
   walker.walk(astng)
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/utils.py", line 518, in walk
   self.walk(child)
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/utils.py", line 518, in walk
   self.walk(child)
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/utils.py", line 518, in walk
   self.walk(child)
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/utils.py", line 515, in walk
   cb(astng)
 File "/tmp/pylint-0.21.1/lib/python2.5/site-packages/pylint/checkers/typecheck.py", line 130, in visit_getattr
   infered = list(node.expr.infer())
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 303, in wrapped
   for res in _func(node, context, **kwargs):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 130, in _infer_stmts
   for infered in stmt.infer(context):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 303, in wrapped
   for res in _func(node, context, **kwargs):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 130, in _infer_stmts
   for infered in stmt.infer(context):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 303, in wrapped
   for res in _func(node, context, **kwargs):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 327, in wrapper
   for node in func(*args, **kwargs):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/inference.py", line 209, in infer_callfunc
   for infered in callee.infer_call_result(self, callcontext):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/scoped_nodes.py", line 591, in infer_call_result
   for infered in returnnode.value.infer(context):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 303, in wrapped
   for res in _func(node, context, **kwargs):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 130, in _infer_stmts
   for infered in stmt.infer(context):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 303, in wrapped
   for res in _func(node, context, **kwargs):
 File "/tmp/logilab/lib/python2.5/site-packages/logilab/astng/bases.py", line 128, in _infer_stmts
   context.lookupname = stmt._infer_name(frame, name)
AttributeError: 'NoneType' object has no attribute '_infer_name'
priorityimportant
typebug
done in0.22.0
load0.300
load left0.000
closed by#99f77cc74cd5 closes #70497: Crash on AttributeError: 'NoneType' object has no attribute '_infer_name' by fixing constant factory