Bug 755488 - AttributeError: 'NoneType' object has no attribute 'statement'
Summary: AttributeError: 'NoneType' object has no attribute 'statement'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pylint
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-21 09:56 UTC by Matthias Runge
Modified: 2012-04-12 02:29 UTC (History)
2 users (show)

Fixed In Version: pylint-0.25.1-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-15 00:10:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Matthias Runge 2011-11-21 09:56:15 UTC
Description of problem:
$ pwd
/usr/lib/python2.7/site-packages/zeitgeist
$ pylint __init__.py
No config file found, using default configuration
************* Module __init__
C: 25,0: Line too long (96/80)
C: 26,0: Line too long (93/80)
C:  1,0: Missing docstring
C:  4,0: Invalid name "runpath" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
W: 14,4: Reimport 'os' (imported line 2)
W: 15,4: Reimport 'sys' (imported line 1)
W: 17,4:RepositoryConfig: Class has no __init__ method
C: 17,4:RepositoryConfig: Missing docstring
Traceback (most recent call last):
  File "/usr/bin/pylint", line 4, in <module>
    lint.Run(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 863, in __init__
    linter.check(args)
  File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 496, in check
    self.check_astng_module(astng, walker, rawcheckers)
  File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 568, in check_astng_module
    walker.walk(astng)
  File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 528, in walk
    self.walk(child)
  File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 528, in walk
    self.walk(child)
  File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 528, in walk
    self.walk(child)
  File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 528, in walk
    self.walk(child)
  File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 525, in walk
    cb(astng)
  File "/usr/lib/python2.7/site-packages/pylint/checkers/variables.py", line 433, in visit_name
    self._loopvar_name(node, name)
  File "/usr/lib/python2.7/site-packages/pylint/checkers/variables.py", line 335, in _loopvar_name
    if not astmts or astmts[0].statement().parent_of(node):
  File "/usr/lib/python2.7/site-packages/logilab/astng/bases.py", line 410, in statement
    return self.parent.statement()
AttributeError: 'NoneType' object has no attribute 'statement'


Version-Release number of selected component (if applicable):
pylint-0.24.0-1.fc16.noarch

How reproducible:
every time

Steps to Reproduce:
1. run pylint against __init__.py from /usr/lib/python2.7/site-packages/zeitgeist
2. (alternatively use http://bazaar.launchpad.net/~zeitgeist/zeitgeist/zeitgeist-0.8/view/head:/zeitgeist/__init__.py )
  
Actual results:
AttributeError: 'NoneType' object has no attribute 'statement'

Comment 1 Matthias Runge 2011-11-21 10:22:33 UTC
reported upstream as ticket https://www.logilab.org/ticket/83565

Comment 2 Matthias Runge 2011-11-23 18:59:54 UTC
Happens with earlier version, too, so this is no regression

AttributeError: 'NoneType' object has no attribute 'statement'
[mrunge@herodot Downloads]$ pylint --version
No config file found, using default configuration
pylint 0.23.0, 
astng 0.21.1, common 0.55.1
Python 2.7.2 (default, Oct 27 2011, 01:40:22) 
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)]

Comment 3 Fedora Update System 2012-03-15 00:19:12 UTC
pylint-0.25.1-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/pylint-0.25.1-1.fc17

Comment 4 Fedora Update System 2012-04-12 02:29:29 UTC
pylint-0.25.1-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.