[Zope-Checkins] reindent.py (Was: CVS: Zope/ZServer - FCGIServer.py:1.19)

Tim Peters tim@zope.com
Wed, 14 Aug 2002 17:00:20 -0400


[Martijn Pieters, on his experience with reindent.py]
> Running it with -drv indeed shows plenty of changes to be made,
> but it blows up with:
>
> checking ./ZServer/medusa/test/max_sockets.py ...
> Traceback (most recent call last):
>   File "/usr/share/doc/python2.1/examples/Tools/scripts/reindent.py", line
> 258, in ?
> ...
>   File "/usr/share/doc/python2.1/examples/Tools/scripts/reindent.py", line
> 174, in run
>     want = have + getlspace(after[jline-1]) - \
> IndexError: list index out of range
>
> This is in a Zope 2.5 branch checkout, with Python 2.1.3 and the Python
> 2.1.3 version of the script..

Ya, that smells familiar, but I don't remember when it got fixed.  It works
OK with a current <wink> Python.

> When not including medusa and gadfly (which were/are externally maintained
> packages),

Good idea to leave these alone!

> cvsdelta tells me that there are 7528 changes in a total of 599 files.
> Many files are touched because the ZPL license header contains
> trailing spaces.
>
> How many objections are there to checking this all in on the Zope Trunk?

It's scary to make this many changes at once.  In the Python codebase, we
started doing this one directory at a time (and that's primarily why, e.g.,
reindent requires an -r switch to *force* directory recursion).  It created
some problems!  They were all in the nature of string literals depending in
gross or subtle ways on containing literal hard tab characters, or even on
containing trailing whitespace.  I can't guess how prevalent that is in the
Zope codebase, although common sense dictates that anyone known to rely on
such tricks would have been shot years ago <wink>.