[Python-projects] pylint problems

Andreas Kostyrka andreas at kostyrka.org
Mon Oct 23 18:42:36 CEST 2006


Hi!

I've upgraded to pylint 0.12.1 and I'm seeing this kind of errors often:

andreas at andi-lap:~/git-sandbox/project-eventspartition> pylint copyrows.py
Problem importing module: classes.pyc
Problem importing module: classes.pyo
Problem importing module: classes.py
No config file found, using default configuration
************* Module copyrows
C: 57: Line too long (102/80)
C: 59: Line too long (118/80)
C: 69: Line too long (93/80)
C:  1: Missing docstring
stmt2 [Function(None, 'parser', [], (), 0, 'create a cmdline parser object', Stmt([Import([('optparse', None)]), Assign([AssName('_parser', 'OP_ASSIGN')], CallFunc(Getattr(Name('optparse'), 'OptionParser'), [Keyword('usage', Const('%prog [options] sourcedb destdb'))], None, None)), Discard(CallFunc(Getattr(Name('_parser'), 'add_option'), [Const('--startid'), Keyword('default', Name('None')), Keyword('type', Const('int')), Keyword('help', Const('Start with this event id'))], None, None)), Discard(CallFunc(Getattr(Name('_parser'), 'add_option'), [Const('--table'), Keyword('default', Const('media_downloads')), Keyword('help', Const('copy this table'))], None, None)), Discard(CallFunc(Getattr(Name('_parser'), 'add_option'), [Const('--endid'), Keyword('type', Const('int')), Keyword('default', Name('None')), Keyword('help', Const('end with this event id'))], None, None)), Discard(CallFunc(Getattr(Name('_parser'), 'add_option'), [Const('--col'), Keyword('action', Const('append')), Keyword('default', List(())), Keyword('help', Const('copy this column'))], None, None)), Discard(CallFunc(Getattr(Name('_parser'), 'add_option'), [Const('--timestamp'), Keyword('default', Name('None')), Keyword('help', Const('timestamp column'))], None, None)), Discard(CallFunc(Getattr(Name('_parser'), 'add_option'), [Const('--stepsize'), Keyword('default', Const(1000)), Keyword('type', Const('int')), Keyword('help', Const('load this many rows at most.'))], None, None)), Return(Name('_parser'))]))]
Traceback (most recent call last):
  File "/usr/bin/pylint", line 4, in ?
    lint.Run(sys.argv[1:])
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 847, in __init__
    linter.check(args)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 481, in check
    self.check_file(filepath, modname, checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 495, in check_file
    astng = self._check_file(filepath, modname, checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 519, in _check_file
    self.check_astng_module(astng, checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 577, in check_astng_module
    self.astng_events(astng, [checker for checker in checkers
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 594, in astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 594, in astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 591, in astng_events
    checker.visit(astng)
  File "/usr/lib/python2.4/site-packages/logilab/astng/utils.py", line 85, in visit
    method(node)
  File "/usr/lib/python2.4/site-packages/pylint/checkers/base.py", line 354, in visit_function
    self._check_redefinition(is_method and 'method' or 'function', node)
  File "/usr/lib/python2.4/site-packages/pylint/checkers/base.py", line 450, in _check_redefinition
    if defined_self is not node and not are_exclusive(node, defined_self):
  File "/usr/lib/python2.4/site-packages/logilab/astng/utils.py", line 141, in are_exclusive
    node = stmt2.parent
AttributeError: 'list' object has no attribute 'parent'

The stmt2 line is just a print I've added before the thing bombs out.

andreas at andi-lap:~/git-sandbox/project-eventspartition> pylint --version
Problem importing module: classes.pyc
Problem importing module: classes.pyo
Problem importing module: classes.py
No config file found, using default configuration
pylint 0.12.1, 
astng 0.16.1, common 0.19.3
Python 2.4.4c0 (#2, Jul 30 2006, 15:43:58) 
[GCC 4.1.2 20060715 (prerelease) (Debian 4.1.1-9)]

Any ideas what is causing this?

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20061023/49773568/attachment-0002.pgp


More information about the Python-Projects mailing list