Email Re: [Python-projects] Re: bug report for pylint - line too long on docstring

from
cc
subject
Re: [Python-projects] Re: bug report for pylint - line too long on docstring
date
2005/08/11 14:40
On Thursday 11 August à 12:55, Stefan Rank wrote:
> on 11.08.2005 12:14 Sylvain Thénault said the following:
> >On Monday 08 August à 16:44, Stefan Rank wrote:
> >
> >>and of course... i did not attach the file ;-)
> >>here it is
> >>
> >>on 08.08.2005 16:31 Stefan Rank said the following:
> >>>hi, small bug report coming:
> >>>
> >>>the attached file produces a::
> >>>
> >>>test.py:2: [C] Line too long (130/100)
> >>>
> >>>for me.
> >>>(100 is my line length limit, but the docstring in the module is
> >>>split over several -shorter- lines)
> >>>
> >>>google knows about one message with a similar report::
> >>>
> >>>http://lists.logilab.org/pipermail/python-projects/2004-August/000138.html
> >
> >Hum, still unable to reproduce this on my linux box. I'll definitly have
> >to find a windows box to test this :(.
> >

> i had a look at the source:
> the culprit seems to be the (use of the) tokenize.generate_tokens
> function. it returns the whole triple-quoted string as one token, but 
> where pylint.checkers.format.FormatChecker.process_tokens calls 
> self.new_line it assumes that the token only brought one new line with it...

> i have no idea why this does not happen on Linux too (and i am too lazy 
> to reboot now ;-)

hum, strange. Which python version are you using ?
 
> à propos: another cross-platform issue: i saw that FormatChecker uses 
> os.linesep in check_lines, which is not a good idea, firstly because not 
> all files have to use the platform's standard linesep (none of my python 
> files on win have a \r in them) and secondly because it gets the lines 
> from tokenize which probably uses 'universal newlines support' and 
> always returns \n - separated lines anyway.

the CVS version doesn't use os.linesep anymore.

-- 
Sylvain Thénault                               LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org