[Python-apps-team] Bug#591676: pylint: please either disable or document dynamic checks

Jakub Wilk jwilk at debian.org
Tue Nov 16 17:11:48 UTC 2010

clone 591676 -1
reassign -1 python-pyicu 1.0-1
severity -1 wishlist
retitle -1 please make _icu importable
retitle 591676 pylint: please either disable or document dynamic checks
severity 591676 important

* Sandro Tosi <morph at debian.org>, 2010-11-16, 01:49:
>> $ echo 'import icu' > test.py
>> $ pylint test.py No config file found, using default configuration
>> ************* Module test
>> C:  1: Missing docstring
>> Traceback (most recent call last):
>>  File "/usr/bin/pylint", line 4, in <module>
>>    lint.Run(sys.argv[1:])
>>  File "/usr/lib/pymodules/python2.6/docs.py", line 27, in <module>
>>    _install__doc__(BreakIterator, '''
>> NameError: name 'BreakIterator' is not defined
>pylint upstream identified the problem in:
>$ python -c "from _icu import *"
>Traceback (most recent call last):
>  File "<string>", line 1, in <module>
>  File "/usr/lib/pymodules/python2.6/icu.py", line 37, in <module>
>    from docs import *
>  File "/usr/lib/pymodules/python2.6/docs.py", line 27, in <module>
>    _install__doc__(BreakIterator, '''
>NameError: name 'BreakIterator' is not defined
>(and don't want to invest further energy on it, understandably). Do
>you think it's ok to reassign this ticket to python-pyicu? AFAICS _icu
>should be a private module, but it prevents 'icu' to be "linted".

Okay, so basically what happens here is:

1. _icu can be imported only if icu has been imported first. It's 
definitely annoying, but I'd have hard time arguing it's actually a bug.

2. pylint will import a module if and only if it cannot find its source. 
This bad because:
- It's surprising and undocumented. According to the package 
description, the manual pages, and the FAQ, pylint is a "static code 
checker", so one would expect it won't execute any code it analyses.
- As seen on the above example, it's a pretty brittle approach.

Jakub Wilk

More information about the Python-apps-team mailing list