[Spambayes-checkins] spambayes/scripts sb_imapfilter.py, 1.7.2.1,
1.7.2.2
Sjoerd Mullender
sjoerd at acm.org
Fri Oct 3 04:30:03 EDT 2003
Tony Meyer wrote:
> Update of /cvsroot/spambayes/spambayes/scripts
> In directory sc8-pr-cvs1:/tmp/cvs-serv31161/scripts
>
> Modified Files:
> Tag: release_1_0
> sb_imapfilter.py
> Log Message:
> Copy Sjoerd's fix into the 1.0 branch.
>
> Hopefully fix [ spambayes-Bugs-816400 ] Crash because of bad date. If appending fails, we now try without the flags, without the date, and without both (which means that information is lost).
>
> In theory, we're only copying this information, so it should be all ok, but in
> practice imap is a PITA.
>
> Index: sb_imapfilter.py
> ===================================================================
> RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v
> retrieving revision 1.7.2.1
> retrieving revision 1.7.2.2
> diff -C2 -d -r1.7.2.1 -r1.7.2.2
> *** sb_imapfilter.py 28 Sep 2003 23:57:12 -0000 1.7.2.1
> --- sb_imapfilter.py 3 Oct 2003 02:58:36 -0000 1.7.2.2
> ***************
> *** 329,333 ****
> parsed_date = parsedate(message_date)
> if parsed_date is not None:
> ! return Time2Internaldate(time.mktime(parsed_date))
> else:
> return Time2Internaldate(time.time())
> --- 329,336 ----
> parsed_date = parsedate(message_date)
> if parsed_date is not None:
> ! try:
> ! return Time2Internaldate(time.mktime(parsed_date))
> ! except OverflowError:
> ! pass
> else:
> return Time2Internaldate(time.time())
> ***************
This was not the complete fix. You also need to remove the else at the
end of the function and dedent the final return.
--
Sjoerd Mullender <sjoerd at acm.org>
More information about the Spambayes-checkins
mailing list