[Python-Dev] Fun with whitespace

Tim Peters tim.one at comcast.net
Sun Jul 18 08:13:06 CEST 2004


Heads up!  Using reindent.py to normalize whitespace in the Tools/scripts
directory uncovered a file with bad syntax problems.  So I repaired that
file's errors, then ran reindent over the entire source tree.

Using reindent once creates a fixed-point:  running reindent again on the
output file won't change it.  That makes reindent an easy way to ensure
files in the core follow the Python coding guidelines.

Before today, I only ran it on hand-selected subdirectories, to minimize the
pain if it broke anything (it can break code that relies on trailing
whitespace being preserved in Python files, and a few cases of that have
occurred over the years; no other case of damage has ever been reported).

All the tests still pass on my box, but perhaps there's damage on other
platforms.

Checking in all the changes is proving to be a challenge, and I'm not sure
checkin msgs are getting sent out for all the changes.  I'm getting lots of
these tracebacks from SF:

Traceback (most recent call last):
  File "/cvsroot/python/CVSROOT/syncmail", line 329, in ?
    main()
  File "/cvsroot/python/CVSROOT/syncmail", line 322, in main
    blast_mail(subject, people, specs[1:], contextlines, fromhost)
  File "/cvsroot/python/CVSROOT/syncmail", line 247, in blast_mail
    resp = conn.sendmail(author, people, s.getvalue())
  File "/usr/lib/python2.2/smtplib.py", line 654, in sendmail
    if not (200 <= self.ehlo()[0] <= 299):
  File "/usr/lib/python2.2/smtplib.py", line 384, in ehlo
    (code,msg)=self.getreply()
  File "/usr/lib/python2.2/smtplib.py", line 335, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")

I think I'm also bumping into never-before-noticed stale CVS locks on files
nobody has touched in years (e.g., Guido has a lock on
Demo/threads/Generator.py).




More information about the Python-Dev mailing list