[spambayes-dev] New sort+group.py

Tim Peters tim.one at comcast.net
Sat Dec 27 14:51:46 EST 2003

[T. Alexander Popiel]
> Trying... but it seems to have major problems with python2.2.

Ah, fiddlesticks -- does someone here still give a rip about Python 2.2?  I
don't.  2.2 is dead -- it's no longer maintained, 2.3.3 is out and
universally regarded as stabler & faster than 2.2.3, and development has
moved on to 2.4.  I'd like to drop all our 2.2 compatibility cruft; it's a
growing mass of dead weight.

> It barfs on enumerate(), and it doesn't seem to be picking up
> continuation lines, either, so I suspect the file reading style
> you're using isn't grokked correctly, either.

Right, it wouldn't.  The easiest pithy explanation is that file objects in
2.2 *have* iterators, but file objects in 2.3 *are* iterators.  To use the
same style of code under both requires getting an explicit iterator,

    it = iter(fh)

and then doing

    for line in it:

everywhere instead of

    for line in fh:

As is, the

    for line in fh:

lines under 2.2 are really jumping across internal file buffers.  That was
crazy behavior, and that's why it got repaired for 2.3 (but the fix couldn't
be backported to 2.2 lest some crazy code relied on the broken behavior).

>> The major thrust of the changes is to order msgs by full-precision
>> UTC timestamp.  It was sorting just by date (not time), and wasn't
>> accounting for that different ISPs may be in different time zones.

> Oops.  Doh.  Thanks for catching that.  All my mail gets received
> and timestamped by my local machine, so the timezones weren't an
> issue... but ignoring time of day entirely is rather embarassing.

Not your fault:  it's not possible to find out time of day under 2.2 either

More information about the spambayes-dev mailing list