rfc822.py date parsing problem

Jeff Epler jepler at unpythonic.net
Sat Jan 17 18:28:48 EST 2004


Probably some message has an invalid date in a header.  In 2.2, I can
get that exception by passing an invalid string to parsedate_tz:
>>> import rfc822
>>> rfc822.parsedate_tz(" ")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/rfc822.py", line 861, in parsedate_tz
    if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
IndexError: list index out of range

guess_delivery_time() should probably recover from this exception, but I
don't know what exactly would be appropriate.

Jeff




More information about the Python-list mailing list