pylint #110213 "No such message id W0704" when using Python 3.3 [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 | |
priority | important |
---|---|
type | bug |
done in | 0.27.0 |
load | 0.500 |
load left | 0.000 |
closed by | #9ee22d817eda use load_module_from_file rather than relative import broken in python 3.3. Closes #110213 |
similar entities
- logilab-common #53393 python3: fix tests and run them also during build
- logilab-astng #83138 AttributeError: Starred object has no attribute 'ass_type'
- logilab-common #104047 Tests fails when run under python3
- logilab-common #120897 Installation fails on Python 3.3
- logilab-common #82161 python3: logilab.common.date.ustrftime() is incompatible
[see all]
Comments
-
2012/11/28 16:25, written by anon
-
2012/12/02 18:19, written by anon
-
2012/12/10 15:49, written by anon
-
2012/12/21 11:57, written by anon
-
2013/01/10 17:38, written by ToBeReplaced
-
2013/01/13 14:05, written by anon
-
2013/01/13 14:09, written by anon
-
2013/01/15 02:55, written by anon
-
2013/01/25 05:47, written by anon
-
2013/01/25 06:04, written by anon
-
2013/02/22 15:18, written by sthenault
- http://www.logilab.org/ticket/120635
- http://www.logilab.org/ticket/120646
add commentsame here with fedora18
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 <module>
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>
I hit the same snag on Fedora 18 using virtualenvwrapper's mkvirtualenv to create the venv, workon venv, then pip install pylint.
Same here with ArchLinux (3.6.10-1-ARCH x86_64) and Python 3.3.0.
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.
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.
I meant TreeRebuilder in astng rebuilder.py in the above post.
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.
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:
In astng rebuilder TreeRebuilder class add:
In astng rebuilder TreeRebuilder class add:
Now in astng rebuilder replace every instance of:
replace with:
replace with:
replace with:
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
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:
You will also find patches attached there, and I would be glad if you could test them.