.. -*- coding: utf-8 -*- Version 0.27.0 -------------- :expected date: n/a Ticket #110840 Add new messages for reporting of suppressed messages and useless suppression pragma ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :state: validation pending Ticket #110853 crash when __init__ method created by assignment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.500 :state: validation pending Ticket #105327 disable all checkers from the command line (to selectively re-enable a few checks) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :load: 0.500 :state: validation pending To run just the similarities checkers it is necessary to use --disable=I,E,W,R,C,F --enable=similarities which is non obvious nor convenient. A nicer alternative would be --disable=all --enable=similarities Comments :: On 2012/09/17 08:18 - vanish wrote : work in progress on https://bitbucket.org/agurney/pylint Ticket #115580 erroneous W0212 (access to protected member) on super call ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.100 :state: validation pending Ticket #120657 give [deprecated-lambda] when a map/filter of a lambda could be a comprehension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :state: validation pending Ticket #113231 logging checker only looks at root logger, not other logger instances ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :state: validation pending logging.critical('test %s' % 1) gives rise to W1201, as expected import logging logger = logging.getLogger(__name__) logger.critical('test %s' % 1) using getLogger as recommended by the logging documentation, doesn't, but should. Comments :: On 2012/12/06 17:51 - LeaChim wrote : Patch available here: https://bitbucket.org/leachimuk/pylint/commits/744ebc66967d40dded1674efbc2ca887a5a971ce > On 2013/02/22 16:40 - sthenault wrote : > integrated, thx Ticket #20693 merge Ian Eure's python-pylint.el ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :state: validation pending http://atomized.org/2010/02/pep8-pylint-in-emacs/ Ticket #110839 pylint-gui: bind F5 to run button ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :load: 0.100 :state: validation pending would make things easier at low cost Ticket #110838 pylint-gui crash when include-ids is activated ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.100 :state: validation pending Ticket #120635 pylint.reporters uses 'cmp' function which has been dropped in py3k ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.100 :state: validation pending Ticket #112550 test_gtk_import fails test_regr.NonRegrTC in 0.26.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :state: validation pending Comments :: On 2012/11/22 17:01 - idella4 wrote : test_gtk_import (test_regr.NonRegrTC) ... FAIL FAIL: test_gtk_import (test_regr.NonRegrTC) ---------------------------------------------------------------------- Traceback (most recent call last) File "/usr/lib64/python2.7/site-packages/logilab/common/testlib.py", line 646, in _proceed testfunc(*args, **kwargs) ['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__red$ ------------------------ local variables ------------------------- File "/mnt/gen2/TmpDir/portage/dev-python/pylint-0.26.0/work/pylint-0.26.0-2.7/test/test_regr.py", line 87, in test_gtk_import self.assertEqual(got, '') ['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__red$ ------------------------ local variables ------------------------- got: 'R: 7:FooButton: Badly implemented Container, implements __len__ but not __delitem__, __getitem__, __setitem__' gtk: self: self._TestCase__exc_info: self._TestCase__testMethodName: 'test_gtk_import' self._cleanups: [] self._current_test_descr: None self._options_: : 'assertMultiLineEqual', : 'assertListEqual', :$ ------------------------------------------------------------------ File "/usr/lib64/python2.7/unittest/case.py", line 511, in assertEqual assertion_func(first, second, msg=msg) ['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__red$ self._type_equality_funcs: {: 'assertMultiLineEqual', : 'assertListEqual', :$ standardMsg: "'R: 7:FooButton: Badly implemented Container, implements __len__ but not __delitem__, __getitem__, __setitem__$ ------------------------------------------------------------------ AssertionError: 'R: 7:FooButton: Badly implemented Container, implements __len__ but not __delitem__, __getitem__, __setitem__' $ Hope this maps it sufficiently. See also https://bugs.gentoo.org/show_bug.cgi?id=442578 Ticket #111799 W1401 check complains incorrectly about \0, but not \o ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :state: validation pending The new (in 0.26.0) check for W1401 ("Anomalous backslash in string") has this definition in it, to enumerate the backslash escapes that are meaningful in Python string literals: ESCAPE_CHARACTERS = 'abfnrtvox\n\r\t\\\'\"' This is not quite right, though. I think the mistake comes from a confusing table in the Python reference at http://docs.python.org/2/reference/lexical_analysis.html#literals . In the escape sequence "\ooo" shown in that table, all of the "o" letters stand for octal digits- there is no "\o" escape in Python. The W1401 check should complain about any "\o" instances in non-raw strings, like it does for \d, etc. And by the same token, "\0" IS a proper (and common) escape sequence in Python, which W1401 erroneously complains about. (See Footnote 3 after that Python reference escape sequences table; it is supported and ok for there to be only one octal digit in the escape sequence. Ticket #112728 Warn about non-string objects in __all__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: enhancement :state: validation pending Python accepts non-string objects in __all__ as long as modules are only imported via 'import X'. If __all__ is inspected due to a from import and non-string objects are found, an exception is raised. Pylint should be able to detect problems like this. Example: def foo(): pass __all__ = [foo] Expected: E????: Invalid object in __all__: foo Ticket #22277 Fragile reimport warning false positives ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.500 :state: validation pending The following examples demonstrate the problem: == bad.py == from package import util as local_util import someother import util == Reimport 'util' (imported line 3) == == good.py == from package import util as localutil import someother import util == No (relevant) errors == Basically, the problem comes down to the non-deterministic dict order and the use of context.values() in the get_first_import() function. Changing context.values() => context.asList() fixes this problem. Comments :: On 2013/02/26 22:37 - sthenault wrote : Fixed by :eid:`112667` Ticket #110213 "No such message id W0704" when using Python 3.3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :type: bug :load: 0.500 :state: validation pending I tried installing to a fresh 3.3 virtualenv. It seems to install okay, but when I run Pylint, it gives an error. I'm using Arch Linux. Install output and error message: ~/Code/pylint-test > virtualenv-3.3 env New python executable in env/bin/python Installing distribute........................................done. Installing pip................done. ~/Code/pylint-test > source env/bin/activate (env) ~/Code/pylint-test > pip install pylint Downloading/unpacking pylint Downloading pylint-0.26.0.tar.gz (222kB): 222kB downloaded Running setup.py egg_info for package pylint warning: no files found matching '*.html' under directory 'doc' warning: no files found matching '*.txt2' under directory 'test' warning: no files found matching 'noext' Downloading/unpacking logilab-common>=0.53.0 (from pylint) Downloading logilab-common-0.58.1.tar.gz (196kB): 196kB downloaded Running setup.py egg_info for package logilab-common package init file './test/__init__.py' not found (or not a regular file) warning: no files found matching '*.py' under directory 'test/input' warning: no files found matching '*' under directory 'doc/html' Downloading/unpacking logilab-astng>=0.21.1 (from pylint) Downloading logilab-astng-0.24.1.tar.gz (106kB): 106kB downloaded Running setup.py egg_info for package logilab-astng package init file './test/__init__.py' not found (or not a regular file) Installing collected packages: pylint, logilab-common, logilab-astng Running setup.py install for pylint Skipping implicit fixer: buffer Skipping implicit fixer: idioms Skipping implicit fixer: set_literal Skipping implicit fixer: ws_comma changing mode of build/scripts-3.3/pylint from 644 to 755 changing mode of build/scripts-3.3/pylint-gui from 644 to 755 changing mode of build/scripts-3.3/symilar from 644 to 755 changing mode of build/scripts-3.3/epylint from 644 to 755 changing mode of build/scripts-3.3/pyreverse from 644 to 755 warning: no files found matching '*.html' under directory 'doc' warning: no files found matching '*.txt2' under directory 'test' warning: no files found matching 'noext' changing mode of /home/jmabey/Code/pylint-test/env/bin/epylint to 755 changing mode of /home/jmabey/Code/pylint-test/env/bin/pylint-gui to 755 changing mode of /home/jmabey/Code/pylint-test/env/bin/pyreverse to 755 changing mode of /home/jmabey/Code/pylint-test/env/bin/pylint to 755 changing mode of /home/jmabey/Code/pylint-test/env/bin/symilar to 755 Installing pylint script to /home/jmabey/Code/pylint-test/env/bin Installing pyreverse script to /home/jmabey/Code/pylint-test/env/bin Installing epylint script to /home/jmabey/Code/pylint-test/env/bin Installing pylint-gui script to /home/jmabey/Code/pylint-test/env/bin Installing symilar script to /home/jmabey/Code/pylint-test/env/bin Running setup.py install for logilab-common package init file './test/__init__.py' not found (or not a regular file) Skipping implicit fixer: buffer Skipping implicit fixer: idioms Skipping implicit fixer: set_literal Skipping implicit fixer: ws_comma package init file './test/__init__.py' not found (or not a regular file) changing mode of build/scripts-3.3/pytest from 644 to 755 deleting logilab_common.egg-info/requires.txt package init file './test/__init__.py' not found (or not a regular file) warning: no files found matching '*.py' under directory 'test/input' warning: no files found matching '*' under directory 'doc/html' Installing /home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab_common-0.58.1-py3.3-nspkg.pth changing mode of /home/jmabey/Code/pylint-test/env/bin/pytest to 755 package init file './test/__init__.py' not found (or not a regular file) Running setup.py install for logilab-astng package init file './test/__init__.py' not found (or not a regular file) Skipping implicit fixer: buffer Skipping implicit fixer: idioms Skipping implicit fixer: set_literal Skipping implicit fixer: ws_comma package init file './test/__init__.py' not found (or not a regular file) File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/nonregr.py", line 35 print v.get('yo') ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/noendingnewline.py", line 42 print 'a' ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/all.py", line 27 def func(): print 'yo' ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/module.py", line 22 print '!!!' ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/notall.py", line 27 def func(): print 'yo' ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/module2.py", line 73 assert `1` ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/appl/myConnection.py", line 26 print 'MyConnection init' ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/data/SSL1/Connection1.py", line 33 print 'init Connection' ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/regrtest_data/package/absimport.py", line 22 print import_package_subpackage_module ^ SyntaxError: invalid syntax File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab/astng/test/regrtest_data/absimp/string.py", line 3 print string ^ SyntaxError: invalid syntax package init file './test/__init__.py' not found (or not a regular file) Installing /home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/logilab_astng-0.24.1-py3.3-nspkg.pth package init file './test/__init__.py' not found (or not a regular file) Successfully installed pylint logilab-common logilab-astng Cleaning up... (env) ~/Code/pylint-test > pylint Problem importing module raw_metrics.py: No module named 'raw_metrics' Problem importing module classes.py: No module named 'classes' Problem importing module misc.py: No module named 'misc' Problem importing module utils.py: No module named 'utils' Problem importing module base.py: No module named 'base' Problem importing module similar.py: No module named 'similar' Problem importing module imports.py: No module named 'imports' Problem importing module exceptions.py: No module named 'exceptions' Problem importing module design_analysis.py: No module named 'design_analysis' Problem importing module variables.py: No module named 'variables' Problem importing module format.py: No module named 'format' Problem importing module newstyle.py: No module named 'newstyle' Problem importing module string_format.py: No module named 'string_format' Problem importing module typecheck.py: No module named 'typecheck' Traceback (most recent call last): File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/pylint/utils.py", line 254, in check_message_id return self._messages[msgid] KeyError: 'W0704' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/jmabey/Code/pylint-test/env/bin/pylint", line 9, in load_entry_point('pylint==0.26.0', 'console_scripts', 'pylint')() File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/pylint/__init__.py", line 21, in run_pylint Run(sys.argv[1:]) File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/pylint/lint.py", line 890, in __init__ linter.disable('W0704') File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/pylint/utils.py", line 192, in disable msg = self.check_message_id(msgid) File "/home/jmabey/Code/pylint-test/env/lib/python3.3/site-packages/pylint/utils.py", line 256, in check_message_id raise UnknownMessage('No such message id %s' % msgid) pylint.utils.UnknownMessage: No such message id W0704 (env) ~/Code/pylint-test > python --version Python 3.3.0 Comments :: On 2012/11/28 16:25 - anon wrote : same here with fedora18 On 2012/12/02 18:19 - anon wrote : On Windows 8 ... I get ... did "easy_install" for pylint and logilab dependencies ...\src>pylint track.py Problem importing module base.py: No module named 'base' Problem importing module classes.py: No module named 'classes' Problem importing module design_analysis.py: No module named 'design_analysis' Problem importing module exceptions.py: No module named 'exceptions' Problem importing module format.py: No module named 'format' Problem importing module imports.py: No module named 'imports' Problem importing module misc.py: No module named 'misc' Problem importing module newstyle.py: No module named 'newstyle' Problem importing module raw_metrics.py: No module named 'raw_metrics' Problem importing module similar.py: No module named 'similar' Problem importing module string_format.py: No module named 'string_format' Problem importing module typecheck.py: No module named 'typecheck' Problem importing module utils.py: No module named 'utils' Problem importing module variables.py: No module named 'variables' Traceback (most recent call last): File "C:\Python33\lib\site-packages\pylint\utils.py", line 254, in check_message_id return self._messages[msgid] KeyError: 'W0704' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Python33\Scripts\pylint-script.py", line 9, in load_entry_point('pylint==0.26.0', 'console_scripts', 'pylint')() File "C:\Python33\lib\site-packages\pylint\__init__.py", line 21, in run_pylint Run(sys.argv[1:]) File "C:\Python33\lib\site-packages\pylint\lint.py", line 890, in __init__ linter.disable('W0704') File "C:\Python33\lib\site-packages\pylint\utils.py", line 192, in disable msg = self.check_message_id(msgid) File "C:\Python33\lib\site-packages\pylint\utils.py", line 256, in check_message_id raise UnknownMessage('No such message id %s' % msgid) pylint.utils.UnknownMessage: No such message id W0704 ...\src> On 2012/12/10 15:49 - anon wrote : I hit the same snag on Fedora 18 using virtualenvwrapper's mkvirtualenv to create the venv, workon venv, then pip install pylint. On 2012/12/21 11:57 - anon wrote : Same here with ArchLinux (3.6.10-1-ARCH x86_64) and Python 3.3.0. On 2013/01/10 17:38 - ToBeReplaced wrote : pylint-0.26.0 seems incompatible with CPython-3.3.0. The function `package_load` in pylint/checkers/__init__.py will not correctly load the checker modules, which is what is causing the bug in this thread. I hacked the file on my local copy to see if I could get it running, but I ran into a number of other issues before the rabbit hole got too deep. First, the TreeRebuilder(3k) in logilab-astng-0.24.1 does not implement methods for some of the nodes it needs. It is missing methods for `visit_try` and `visit_yieldfrom`. Patching those with dummies got me to an issue visit_with, where I had to give up. On 2013/01/13 14:05 - anon wrote : I had the same problem with visit_try , visit_yieldfrom, and visit_with using Eclipse and pylint 0.26.0;python 3.3; astng 0.24.1; common 0.58.3. visit_yieldfrom and visit_with were resolved by manually downloading astng 0.24.1 from the python website and manually installing. Did the same with common. This version of 0.24.1 contains visit_with and visit_yieldfrom methods. I had tried using pip before. I also made a visit_try method in TreeBuilder and copied the visit_tryelse method body from TreeBuilder and that resolved that(not a good fix but one that made it start working). I also was getting the no module named* errors. I replaced this line in pylint.checkers package_load to fix(not ideal I think): #module = __import__(basename, globs, globs, None) import importlib module = importlib.import_module("pylint.checkers." + basename) I also loaded the src for common, astng, pylint and fixed some imports that eclipse said weren't working. Not sure if I needed to do this it was an early fix attempt. But try it if the above still doesn't fix it. Also there's a cmp method pylint.reporters __init__ diff_string that doesn't work with 3.# python. I found this workaround on some site: def cmp(a, b): return (a > b) - (a < b) Not sure if I really need this since I'm not sure I use reporters with eclipse since I turn off reports with --reports=n. Maybe reporters doesn't have anything to do with reports. Worth trying it out if the above doesn't fix it. On 2013/01/13 14:09 - anon wrote : I meant TreeRebuilder in astng rebuilder.py in the above post. On 2013/01/15 02:55 - anon wrote : Actually visit_yieldfrom isn't in astng. Though it just gives an error message and pylint still works I guess. Also the visit_try fix doesn't really fix anything it just allows pylint to not error out. I don't think try blocks will get processed correctly. On 2013/01/25 05:47 - anon wrote : I was able to get visit_try to work with 3.3. Although it's not ideal it does pass the unit tests involved with testing try blocks. Even so, the unit tests didn't pick out every situation so you might have to add more fixes to different newnode attributes than the ones listed below. In astng rebuilder add: .. sourcecode:: python from _ast import Try In astng rebuilder TreeRebuilder class add: .. sourcecode:: python def try_fix(self , newnode, node, attr=""): newNodeBlock = [] for child in getattr(node, attr): if isinstance(child, Try): newNodeBlock.extend(self.visit(child, newnode)) else: newNodeBlock.append(self.visit(child, newnode)) setattr(newnode, attr, newNodeBlock) In astng rebuilder TreeRebuilder class add: .. sourcecode:: python def visit_try(self, node, parent): newnodes = [] if node.finalbody: newnodes.append(self.visit_tryfinally(node, parent)) newnodes.append(self.visit_tryexcept(node, parent)) return newnodes Now in astng rebuilder replace every instance of: .. sourcecode:: python newnode.body = [self.visit(child, newnode) for child in node.body] replace with: .. sourcecode:: python self.try_fix(newnode, node, 'body') .. sourcecode:: python newnode.handlers = [self.visit(child, newnode) for child in node.handlers] replace with: .. sourcecode:: python self.try_fix(newnode, node, 'handlers') .. sourcecode:: python newnode.orelse = [self.visit(child, newnode) for child in node.orelse] replace with: .. sourcecode:: python self.try_fix(newnode, node, 'orelse') On 2013/01/25 06:04 - anon wrote : Another fix to astng rebuilder for python 3 only: In astng rebuilder TreeRebuilder visit_with function change all: node.context_expr replace with: node.items[0].context_expr On 2013/02/22 15:18 - sthenault wrote : Please stop adding python3.3 related bugs as comment in this thread, rather add new tickets. I've added the following tickets extracted from this thread: * http://www.logilab.org/ticket/120635 * http://www.logilab.org/ticket/120646 You will also find patches attached there, and I would be glad if you could test them.