Email pylint checker.__doc__ is None

to
Sylvain Thenault <syt at logilab dot fr>
subject
pylint checker.__doc__ is None
date
2005/02/11 00:11

pylint module, tmptestleo4u
running pylint, C:\C\PY\PYTHON233\python.exe -tOO  -c "import sys; from
logilab.pylint import lint;                  
lint.Run([r'tmptestleo4u',])" 
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "C:\C\PY\PYTHON~1\lib\site-packages\logilab\pylint\lint.py", line
675, in __init__
    ), reporter=reporter, pylintrc=rcfile)
  File "C:\C\PY\PYTHON~1\lib\site-packages\logilab\pylint\lint.py", line
259, in __init__
    self.register_checker(self)
  File "C:\C\PY\PYTHON~1\lib\site-packages\logilab\pylint\lint.py", line
305, in register_checker
    need_space = 80 - (len(checker.__doc__.splitlines()[-1]) % 80)
AttributeError: 'NoneType' object has no attribute 'splitlines'

woops, must not have tested with python optomized...

heres a fix for python -OO not sure about python -O
### lint.py
            try:
                assert(1 == 0)
                if checker.__doc__ is None:
                    #print 'you may have run python -OO .pyo'
                    checker.__doc__ = """\n"""
            
            except AssertionError:
                pass
### etc
            need_space = 80 - (len(checker.__doc__.splitlines()[-1]) %
80)

from the pylint page: this seems backwards
Stable release is PyLint 0.6 
Development release is PyLint 0.5.0 

I downloaded version 6 anyway last month
only installed it today, discovered the above problem right away
then went back to your ftp page to look for a new version,
but for some reason my browser didn't refresh that page.
 (probably should have a meta expire on it.
 sounds like a server configutation thing though I could be wrong.
 my browser doesn't always refresh on sorceforge forums either.)
upon downloading and reading the list archive
discovered there is a 0.6.1 release 
luckily I thought to refresh the page or I still woulden't see it.
download & install and this also has the same problem.
I have fallen into the same trap of __doc__ manipulation under python -OO
and without alot of research into what else might work
just did the obvious and tested for __doc__ is None.
you can maybe find a better way. I thank you in advance.

so now in addition to testing py2.2 2.3 2.4 and 2.5
lets not forget once and a while to run -t -O and other options.
the fun never ends.

do we have anything like a test suite of errors for python?
there used to be many for the c language that were very useful.
in my casual testing, python can't return the correct line number
for quite a few errors and thus make pylint and pychecker look bad.

thanks for pylint especially!

please mangle or delete my email address to avoid spam. thanks.