[Python-projects] Using plugins, options and .pylintrc crashes PyLint

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Apr 2 09:37:35 CEST 2009


Le Friday 27 March 2009 15:48:10 Dore Laurent, vous avez écrit :
> I am trying to create a plugin that declares its own options for use
> with the .pylintrc file.
> This only works when the plugin is auto-loaded from the pylint.checkers
> package.
> When the plugin is outside pylint.checkers (given by .pylintrc's
> load-plugins), I get the traceback:
> Traceback (most recent call last):
>   File "D:\Apps\Python26\lib\runpy.py", line 121, in _run_module_as_main
>     "__main__", fname, loader, pkg_name)
> ConfigParser.DuplicateSectionError: Section 'CUSTOMCHECK' already exists

> Analysis:
> This happens because, in lint.py, class Run, method __init__:
> a. Internal plugins are loaded (using
> linter.load_plugin_modules(self._plugins)
> b. The .pylintrc file is loaded (using linter.read_config_file(), this
> overrides already declared contents)
> c. External plugins are loaded (using
> linter.load_plugin_modules(plugins)).
>    This last step fails, as logilab-common is trying to (re-)add a
> section that already exists in the config file, loaded in b.


Thank you for this very detailed report! I'll take a look at this asap.
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science

More information about the Python-Projects mailing list