#418 Wrong Python Path for pylint

1.2.6
closed-fixed
nobody
None
5
2007-01-29
2007-01-25
No

Suddenly my Products directory is not in the PYTHONPATH anymore.
The Project Properties contain the folder in which my Products dir is, and Products has an empty __init__.py folder, but nothing is found, and I see this error, which actually confuses me:

java.lang.RuntimeException: PyLint ERROR:
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\pylint\lint.py", line 894, in ?
Run(sys.argv[1:])
File "C:\Python24\Lib\site-packages\pylint\lint.py", line 847, in __init__
linter.check(args)
File "C:\Python24\Lib\site-packages\pylint\lint.py", line 481, in check
self.check_file(filepath, modname, checkers)
File "C:\Python24\Lib\site-packages\pylint\lint.py", line 504, in check_file
modname = '.'.join(modpath_from_file(filepath))
File "C:\Python24\lib\site-packages\logilab\common\modutils.py", line 169, in modpath_from_file
raise ImportError('Unable to find module for %s in %s' % (
ImportError: Unable to find module for C:\Dokumente und Einstellungen\1\workspace\dev1\src\Products\Alpha\Permissions.py in C:\Python24\Lib\site-packages\pylint,
C:\Python24\Lib\site-packages\pylint,
c:\python24\lib\site-packages\setuptools-0.6c1-py2.4.egg,
c:\python24\lib\site-packages\zopeskel-0.3dev_r27063-py2.4.egg,
c:\python24\lib\site-packages\elementtree-1.2.6_20050316-py2.4-win32.egg,
C:\WINDOWS\system32\python24.zip,
C:\Python24\Lib\site-packages\pylint,
c:\python24\DLLs,
c:\python24\lib,
c:\python24\lib\plat-win,
c:\python24\lib\lib-tk,
c:\python24,
c:\python24\lib\site-packages,
c:\python24\lib\site-packages\PIL,
c:\python24\lib\site-packages\gtk-2.0,
c:\python24\lib\site-packages\win32,
c:\python24\lib\site-packages\win32\lib,
c:\python24\lib\site-packages\Pythonwin,
c:\python24\lib\site-packages\wx-2.6-msw-unicode
at org.python.pydev.builder.pylint.PyLintVisitor$PyLintThread.passPyLint(PyLintVisitor.java:231)
at org.python.pydev.builder.pylint.PyLintVisitor$PyLintThread.run(PyLintVisitor.java:108)

Discussion

  • Mike Auty

    Mike Auty - 2007-01-27

    Logged In: YES
    user_id=230582
    Originator: NO

    I don't get the pylint error, but using 1.2.6 the PYTHONPATH isn't passed to pylint, and it reports lots of errors about not being able to locate my package imports. I've reverted to 1.2.5 since this makes pylint more of a hinderance than a help at this point...

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2007-01-29

    Logged In: YES
    user_id=617340
    Originator: NO

    Fixed in the cvs (for 1.2.7 )

     
  • Patrick Gerken

    Patrick Gerken - 2007-01-29

    Logged In: YES
    user_id=1324112
    Originator: YES

    Hello fabioz, did you fix what caused the traceback, or that pythonpath gets evaluated?
    I started to look into it myself, and it seems that the simplepythonrunner does not add the PYTHONPATH, because it does not pass the interpreter information to getEnvironment, thus getEnvironment does not know it wants a PYTHONPATH and just returns the standard environment.
    I am trying to change this behaviour, but I want to do it with unit tests, and I did not manage to create a project in the test yet.
    I believe I can add this functionality with tests in this week.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2007-01-29
    • status: open --> closed-fixed
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2007-01-29

    Logged In: YES
    user_id=617340
    Originator: NO

    Both ;-)

    Actually, the problem was that the method from SimpleRunner (SimplePythonRunner is a subclass):

    getEnvironment(project, null); //when the interpreter is null, it should use the default interpreter

    but then it would try to check if it has info on the 'null' interpreter (which it never had) and would return no environment... now, that method hasInfoOnInterpreter will treat receiving 'null' as if the default interpreter is chosen (and return correctly if there's info on the default interpreter).

    Cheers,

    Fabio

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks