[Zope3-checkins] CVS: Products3/z3checkins - message.py:1.23
Gintautas Miliauskas
gintas at pov.lt
Mon Feb 9 05:17:27 EST 2004
Update of /cvs-repository/Products3/z3checkins
In directory cvs.zope.org:/tmp/cvs-serv15325
Modified Files:
message.py
Log Message:
Added a workaround to accept messages that don't specify a timezone in the
date. This is an RFC-822 violation, but the public archives on the web
at <http://mail.zope.org/pipermail/zope-checkins> have this problem.
=== Products3/z3checkins/message.py 1.22 => 1.23 ===
--- Products3/z3checkins/message.py:1.22 Tue Jan 13 12:08:54 2004
+++ Products3/z3checkins/message.py Mon Feb 9 05:17:26 2004
@@ -186,11 +186,18 @@
author = m.getheader('From')
author_name, author_email = m.getaddr('From')
date = m.getheader('Date')
+
# Fix incorrect timezones (+XX:XX instead of RFC-822 mandated +XXXX)
if date[-3] == ':':
date = date[:-3] + date[-2:]
+
(year, month, day, hours, minutes, seconds,
weekday, yearday, dst, tzoffset) = rfc822.parsedate_tz(date)
+
+ # XXX a workaround to deal with messages that don't specify a timezone
+ if tzoffset is None:
+ tzoffset = 0
+
date = datetime(year, month, day, hours, minutes, seconds,
tzinfo=FixedTimezone(tzoffset / 60))
More information about the Zope3-Checkins
mailing list