[Python-projects] [patch] Handling non-existing files
Emile Anclin
emile.anclin at logilab.fr
Mon Nov 24 18:47:00 CET 2008
On Sun, Nov 16, 2008 at 04:24:51PM +0200, V.Chukharev wrote:
> Hi,
>
> If file 'tttt' does not exist, 'pylint tttt' gives the following.
>
> $ pylint tttt
> No config file found, using default configuration
> Traceback (most recent call last):
> File "/usr/local/bin/pylint", line 4, in <module>
> lint.Run(sys.argv[1:])
> File "/usr/local/lib/python2.5/site-packages/pylint/lint.py", line 890, in __init__
> linter.check(args)
> File "/usr/local/lib/python2.5/site-packages/pylint/lint.py", line 457, in check
> filemods = self.expand_files(files_or_modules)
> File "/usr/local/lib/python2.5/site-packages/pylint/lint.py", line 517, in expand_files
> self.set_current_module(modname)
> File "/usr/local/lib/python2.5/site-packages/pylint/lint.py", line 543, in set_current_module
> self.stats['by_module'][modname] = {}
> TypeError: 'NoneType' object is unsubscriptable
> $ pylint --version
> No config file found, using default configuration
> pylint 0.15.1,
> astng 0.17.3, common 0.35.0
> Python 2.5.2 (r252:60911, Sep 8 2008, 21:21:48)
> [GCC 4.2.1 20070719 [FreeBSD]]
>
>
> With the attached one-line patch applied, a reasonable error message is given:
>
> $ pylint tttt
> No config file found, using default configuration
> ************* Module tttt
> F: 1: No module named tttt
thanks; this ticket :
http://www.logilab.org/ticket/5634
has been fixed in pylint 0.15.2
--
Emile Anclin
More information about the Python-Projects
mailing list