pylint etc. for python 3

  • atthecorner

    atthecorner - 2011-07-27

    All this pylint activity has me  looking for pylint ( and dependent packages) that can lint python 3 code. My reading of the and activestate site pages suggested to me that pylint release 0.22.0, or 0.24.0 would  The scripts fail in a way that suggest they are python 2.7 code. 

    I figure folks here might know definitively.  I guess the question is: Does a a pylint package anywhere exist for Windows and python 3.2. 


  • Piotr Dobrogost

    Piotr Dobrogost - 2011-07-27

    I tried installing pylint 0.24.0 on Python 3.2.1 and got this:

      Running egg_info for package unittest2
        Traceback (most recent call last):
          File "<string>", line 14, in <module>
          File "c:\python\virtualenv\pylint-py3.2\build\unittest2\", line 12, in <module>
            from unittest2 import __version__ as VERSION
          File "unittest2\", line 40, in <module>
            from unittest2.collector import collector
          File "unittest2\", line 3, in <module>
            from unittest2.loader import defaultTestLoader
          File "unittest2\", line 92
            except Exception, e:

  • Piotr Dobrogost

    Piotr Dobrogost - 2011-07-27

    Although there is a version of unittest2 for Python 3 ( I think logilab-common (needed by pylint) should use std unittest from Python 3 (which unittest2 is a backport of).

  • atthecorner

    atthecorner - 2011-07-27

    re: unittest instead of unittest2. I agree.

    While completing a pylint windows port seemed to be a suggestion for the google summer of code. I could not see that anyone signed up for it.

    Logilab reports that a pylint 0.24.0 works on linux. I will pursue that. I need to port periodically anyway. We'll see.

  • atthecorner

    atthecorner - 2011-07-28

    Your error is different from mine. My pylint 0.24.0 error trace follows.

    First error is:                                                                  LookupError: unknown encoding: IBO-8859-1
    Which perhaps provokes the second error:            SyntaxError: unknown encoding: IBO-8859-1

    Then again perhaps not.

    ….  Initial lines deleted  …

    Skipping implicit fixer: buffer
    Skipping implicit fixer: idioms
    Skipping implicit fixer: set_literal
    Skipping implicit fixer: ws_comma
    Can't parse build\lib\pylint\test\input\ ParseError: bad input: type=4, value='\n', context=('', (1, 8))
    Traceback (most recent call last):
      File "C:\opt\Python-3.2\lib\lib2to3\pgen2\", line 290, in find_cookie
        codec = lookup(encoding)
    LookupError: unknown encoding: IBO-8859-1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "", line 187, in <module>
      File "", line 183, in install
      File "C:\opt\Python-3.2\lib\distutils\", line 149, in setup
      File "C:\opt\Python-3.2\lib\distutils\", line 919, in run_commands
      File "C:\opt\Python-3.2\lib\distutils\", line 938, in run_command
      File "C:\opt\Python-3.2\lib\distutils\command\", line 571, in run
      File "C:\opt\Python-3.2\lib\distutils\", line 315, in run_command
      File "C:\opt\Python-3.2\lib\distutils\", line 938, in run_command
      File "C:\opt\Python-3.2\lib\distutils\command\", line 128, in run
      File "C:\opt\Python-3.2\lib\distutils\", line 315, in run_command
      File "C:\opt\Python-3.2\lib\distutils\", line 938, in run_command
      File "", line 59, in run
      File "C:\opt\Python-3.2\lib\distutils\", line 645, in run_2to3
        return run_2to3(files, self.fixer_names, self.options, self.explicit)
      File "C:\opt\Python-3.2\lib\distutils\", line 593, in run_2to3
        r.refactor(files, write=True)
      File "C:\opt\Python-3.2\lib\lib2to3\", line 296, in refactor
        self.refactor_file(dir_or_file, write, doctests_only)
      File "C:\opt\Python-3.2\lib\lib2to3\", line 336, in refactor_file
        input, encoding = self._read_python_source(filename)
      File "C:\opt\Python-3.2\lib\lib2to3\", line 328, in _read_python_source
        encoding = tokenize.detect_encoding(f.readline)
      File "C:\opt\Python-3.2\lib\lib2to3\pgen2\", line 310, in detect_encoding
        encoding = find_cookie(first)
      File "C:\opt\Python-3.2\lib\lib2to3\pgen2\", line 293, in find_cookie
        raise SyntaxError("unknown encoding: " + encoding)
    SyntaxError: unknown encoding: IBO-8859-1