logilab-astng #101534 pyreverse crash on folder, single files work though [validation pending]
Pyreverse crashes during Parsing of a Jython Project, which can be fully parsed by pylint. The crash appears in different branches, after all files in the directory to be analyzed have been processed ("parsing filename.py..." has been written to the console). If pyreverse is run on every file (including "__init__.py" seperatly it does not crash.
Below you will find the traceback. I used the latest versions (as of writing this no older than one hour) of comopon, astang, pylint from the repository, I pulled pylint from http://hg-lab.logilab.org/review/pylint.
Traceback (most recent call last): File "./jython2.7a2/bin/pyreverse", line 5, in pkg_resources.run_script('pylint==0.25.2', 'pyreverse') File "/home/ted/jython2.7a2/Lib/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script File "/home/ted/jython2.7a2/Lib/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1207, in run_script File "/home/ted/jython2.7a2/Lib/site-packages/pylint-0.25.2-py2.7.egg/EGG-INFO/scripts/pyreverse", line 4, in main.Run(sys.argv[1:]) File "/home/ted/jython2.7a2/Lib/site-packages/pylint-0.25.2-py2.7.egg/pylint/pyreverse/main.py", line 126, in __init__ PyreverseCommand(args) File "/home/ted/jython2.7a2/Lib/site-packages/pylint-0.25.2-py2.7.egg/pylint/pyreverse/main.py", line 98, in __init__ self.run(args) File "/home/ted/jython2.7a2/Lib/site-packages/pylint-0.25.2-py2.7.egg/pylint/pyreverse/main.py", line 112, in run diadefs = handler.get_diadefs(project, linker) File "/home/ted/jython2.7a2/Lib/site-packages/pylint-0.25.2-py2.7.egg/pylint/pyreverse/diadefslib.py", line 228, in get_diadefs diagrams = DefaultDiadefGenerator(linker, self).visit(project) File "/home/ted/jython2.7a2/Lib/site-packages/logilab_astng-0.24.0-py2.7.egg/logilab/astng/utils.py", line 103, in visit self.visit(local_node) File "/home/ted/jython2.7a2/Lib/site-packages/logilab_astng-0.24.0-py2.7.egg/logilab/astng/utils.py", line 100, in visit methods[0](node) File "/home/ted/jython2.7a2/Lib/site-packages/pylint-0.25.2-py2.7.egg/pylint/pyreverse/diadefslib.py", line 161, in visit_module self.linker.visit(node) File "/home/ted/jython2.7a2/Lib/site-packages/logilab_astng-0.24.0-py2.7.egg/logilab/astng/utils.py", line 103, in visit self.visit(local_node) File "/home/ted/jython2.7a2/Lib/site-packages/logilab_astng-0.24.0-py2.7.egg/logilab/astng/utils.py", line 100, in visit methods[0](node) File "/home/ted/jython2.7a2/Lib/site-packages/logilab_astng-0.24.0-py2.7.egg/logilab/astng/inspector.py", line 257, in visit_from fullname = get_module_part(fullname) File "/home/ted/jython2.7a2/Lib/site-packages/logilab_astng-0.24.0-py2.7.egg/logilab/astng/inspector.py", line 257, in visit_from fullname = get_module_part(fullname) File "/home/ted/jython2.7a2/Lib/site-packages/logilab_common-0.58.2-py2.7.egg/logilab/common/modutils.py", line 340, in get_module_part assert context_file is not None, \ AssertionError: explicit relative import, but no context_file? | |
priority | normal |
---|---|
type | bug |
done in | 0.24.1 |
load left | 0.000 |
closed by | <not specified> |
similar entity
Comments
-
2012/08/01 12:48, written by lothiraldan
-
2012/08/01 14:20, written by malte.vesper
-
2012/08/01 15:17, written by lothiraldan
-
2012/08/01 14:44, written by sthenault
-
2012/08/01 15:11, written by lothiraldan
-
2012/08/01 15:31, written by lothiraldan
-
2012/08/16 07:06, written by malte.vesper
add commentWhich jython project do you try to pyreverse?
My own. Do you need to take a look at the source? If we can avoid that I would appreciate it, but if there are special options to increase e.g. the verbosity of the output tell me, and I will generate all resources that might be helpfull
We will try to avoid to ask you the sources. Do you use specific feature of Jython in your project (call java code, java beans, ...). Is it the first time you tried to run pyreverse on your project? Did pyreverse worked before? Could you tried to goes back in your project history and try to run pyreverse on several of your commits (git and mercurial has bisect command which may help you).
We will need also some details about your environment, which OS, Jython version, anything that can help us to reproduce the problem.
the pb seems to be in the call to get_module_part which should be given a context file.
Do you run pylint on Jython or CPython?
It look like another ticket, could you try with this patch: https://www.logilab.org/comment/92374 (you will likely to patch it by hand, patch is quite old and line numbers has change)?
Hi, I am sorry I took so long to answer, but I was on vacation. The patch works fine. I hope you can incorporate it into astng in the repositories soon (as stated in the refered bug report (how do I get links to individual posts??)). Is there any reason why this patch is not in the repository?