.. -*- coding: utf-8 -*- Version 0.13.0 -------------- rpython checks :publication date: 2007/03/01 :expected date: n/a Ticket #3209 Differentiate between unused 'import X' and unused 'from X import *" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :load: 0.250 :state: resolved the requester Daniel Drake submitted a patch for this. Ticket #2465 M2Crypto SSLServer subclassing problem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: rejected Running pylint on code that subclasses M2Crypto's SSLServer class causes it to complain about "access to undefined member" for member data and functions that are defined through inheritance. This causes errors to be logged for code that was previously reported clean. One of the errors that is reported is: Component.py:220: [E, Component.serve_forever] Access to undefined member 'handle_request' Ticket #3205 W0704 (except doesn't do anything) false positive if some statements follow a "pass" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: resolved :: try: pass except: pass # pylint: disable-msg=W0702 print 'failed to do nothing' PyLint reports "W0704: 3: Except doesn't do anything". Ticket #3218 allow use of "disable-all" option inline ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :load: 0.250 :state: resolved patch submitted by Daniel Drake Ticket #3216 E1101 false positive with numarray.randint ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: resolved Daniel Drake reported: :: import numarray as na import numarray.random_array as nar im16 = nar.randint(0, 256, 300).astype(na.UInt8) The above program causes pylint to complain: :: E1101: 3: Instance of 'int' has no 'astype' member This is with numarray-1.5.2. The randint function returns either a numarray or an int. In this context it will only return a numarray so .astype() is valid. Syt: hard to fix... A possible solution might be to: * issue E1101 when the searched member is not found on every infered value * issue another warning when the searched member is not found on some infered value but found on another (or don't issue anything in this case?) The best solution would be to be able to understand the flow according to given argument value, but we're still far away from that... Ticket #3156 --init-hooks option to fix for instance pytgtk.require problem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :load: 0.250 :state: resolved Usage example: :: pylint --init-hook='import pygtk; pygtk.require("2.6")' [other options] mymodule Ticket #3285 option for Visual Studio line number reporting ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :load: 0.250 :state: resolved Request by Olaf Meding: I would be great if support for MS Visual Studio could be added in terms of reporting line numbers. Currently the output format of PyLint is:: C:\somepath\somefile.py:12: [C0301] Line too long (116/80) What is needed is:: C:\somepath\collect.py(12): [C0301] Line too long (116/80) I edited the below file for now. site-packages\pylint\reporters\text.py:: #self.writeln('%s:%s: [%s%s] %s' % (path, line, sigle, obj, msg)) self.writeln('%s(%s): [%s%s] %s' % (path, line, sigle, obj, msg)) All that is needed is changing ":n:" to "(n):", where n is the line number. Many thanks for considering making this configurable. Ticket #3184 PyLint crashes when encountering "return outside function" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: resolved Marteen reported : If I run PyLint on the following program:: return It crashes like this:: 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 392, in visit_return self._returns[-1].append(node) IndexError: list index out of range Ticket #3214 pylint doesn't like numpy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: rejected Skip reported: Given this one-line script: :: from numpy import array, identity, matrixmultiply, dot pylint reports: :: pylintnumpy.py:1: [E] No name 'array' in module 'numpy' pylintnumpy.py:1: [E] No name 'identity' in module 'numpy' pylintnumpy.py:1: [E] No name 'matrixmultiply' in module 'numpy' pylintnumpy.py:1: [E] No name 'dot' in module 'numpy' pylintnumpy.py:1: [W] Unused import matrixmultiply pylintnumpy.py:1: [W] Unused import identity pylintnumpy.py:1: [W] Unused import array pylintnumpy.py:1: [W] Unused import dot pylint 0.12.1 astng 0.16.1 common 0.19.2 numpy 0.9.6.2138 Python 2.4.2 Comments :: On 2009/09/03 11:35 - anon wrote : This error can be reproduced with numpy version 1.0.4 and before. Did you use such version for the tests ? On 2010/04/22 13:23 - anon wrote : I also still see this here with pylint 0.20.0 and numpy 1.3.0. On 2010/04/22 13:23 - anon wrote : I also still see this here with pylint 0.20.0 and numpy 1.3.0. On 2010/04/22 13:23 - anon wrote : I also still see this here with pylint 0.20.0 and numpy 1.3.0. On 2010/05/20 15:47 - jdekloe wrote : Confirmed on my side as well with pylint 0.20.0 and numpy 1.3.0. In addition I also get a crash of python itself: *** glibc detected *** /usr/bin/python: corrupted double-linked list: 0x00000000030dc710 *** don't know if that could be related to this issue. For your reference, I use python 2.6.2 on a Fedora12 64 bit system (AMD processor). On 2010/05/20 22:53 - mkiilerich wrote : jdekloe: see http://www.logilab.org/ticket/23009 and for example http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581058 Ticket #3282 python2.3 compat / set usage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.000 :state: resolved The 0.12.2 version uses set objects in checkers/typecheck.py but does not import it from logilab.common.compat Comments :: On 2007/02/09 08:31 - adimascio wrote : Ticket #3422 rpython checks ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :load: 3.000 :state: resolved Check rpython stuff * xx.replace only works with a single char * unsupported operations * mixing types * non initialized variable before if/then/else block * ... Ticket #2479 W0212 "ethod could be a function" false positive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: resolved W0212, Method could be a function shouldn't be emitted in case like (factory method pattern) :: class XA: pass class XB(XA): pass class XC(XA): pass class A: def MakeX(self): return XA() class B(A): def MakeX(self): return XB() class C(A): def MakeX(self): return XC() Ticket #3123 W0212 false positive on static method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: resolved Duncan reported : :: class Thing(object): ''' example class ''' _next_id = 0 __slots__ = ('number', 'name') def __init__(self, name): self.number = Thing.next_id() self.name = name def __str__(self): return '(number=%d, name="%s")' % (self.number, self.name) def next_id(): ''' static method to increment "private" class attribute ''' Thing._next_id += 1 return Thing._next_id next_id = staticmethod(next_id) gives : :: W: 20:Thing.next_id: Access to a protected member _next_id of a client class W: 21:Thing.next_id: Access to a protected member _next_id of a client class Ticket #2485 W0222 "Signature differs from overriden method" false positive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.250 :state: resolved Maarten ter Huurne: :: class Super(object): def method(self, param): raise NotImplementedError class Sub(Super): def method(self, param = 'abc'): pass Output: :: W0222: 6:Sub.method: Signature differs from overriden method Since "Sub.method" can be called with 1 parameter just like its abstract declaration, I think the code above is correct, so the warning should not be issued.