from
Sylvain Thénault <sylvain.thenault at logilab dot fr>
to
Neil Benn <benn at cenix-bioscience dot com>
cc
Python-Projects <python-projects at lists dot logilab dot org>
subject
Re: [Python-projects] Tracing PyLint
date
On Wednesday 20 July à 15:32, Neil Benn wrote:2005/07/21 10:20
> Hello,
Hello,
> I'm running pylint across a codebase (which contains a lot of
> magic <I didn't write it!>) and I'm getting an error from pylint as follows:
>
> ----------------------
>
> C:\Documents and Settings\benn.CENIX-SCIENCE\My
> Documents\svnfiles\CeLMA>python "c:\program
> files\python23\Lib\site-packages\pylint\lint.py" --rcfile
> Tools\pylint-pdk-config.prop --files-output=y
> --disable-msg=W0223,C0301,R0921,R0922 Contrib\pdk
> Traceback (most recent call last):
> File "c:\program files\python23\Lib\site-packages\pylint\lint.py",
> line 769, in ?
> Run(sys.argv[1:])
[...]
> files\python23\Lib\site-packages\pylint\checkers\format.py", line 139,
> in check_line
> clean_str = STRING_RGX.sub('', line)
> RuntimeError: maximum recursion limit exceeded
>
> ----------------------
>
> Now I'm assuming tha there is some kind of magic which is causing
> the problem in pyLint - however looking at the file produced, the last
> module checked was simply a file containg a load of Base64 encoded
> images as constants so I think that nothing is happening there. So it
> must be the next module which is inspected that is causing the problem,
> however there is no listing for the module which is blowing up (so I
> assume that it is a first pass so I can't get info). I was thinking of
> running pyLint and keeping the interpreter alive and digging through the
> loaded namespace areas to find out the values for module and code line
> currently being inspected to cause PyLint to throw the error but I don't
> really know what I'm looking for.
>
> Is this the way to determine what pyLint is currently looking at?
well, it's one, but it's not always that easy because of "raw" checkers,
which work directly on the module stream without giving current location
information to the pylint engine, except when displaying a message. In
those cases you may have to add some debugging statements to the desired
checker.
> If so then what should I be looking at, if not could someone please
> suggest as to a useful method to determine what code is causing (Module
> and line) is causing PyLint to blow up on me.
Anyway, the best way is to launch pylint with "python -i" and then to
run pdb to inspect the stack.
> The code is open sourced so if you want to try this for yourself
> then the source code can be checked out using svn with the command line:
>
>
> svn co http://svn.pdk.python-hosting.com/trunk pdk
I've checked this, and the problem in on line 97 of BitmapData.py. The
wizardBmp string drives the python 2.3 regular expression engine crazy !
Running pylint with python 2.4 fix the problem.
--
Sylvain Thénault LOGILAB, Paris (France).
http://www.logilab.com http://www.logilab.fr http://www.logilab.org
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects
