aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortkikuchi <>2005-02-05 07:56:47 +0000
committertkikuchi <>2005-02-05 07:56:47 +0000
commitb8a931284d51365af2d14c1d7804cc8b7711b57f (patch)
tree69ac6ec22911d2ce834bcf19cdbe5033b2faed4c
parent435095e311920261a6e6df2ccedc056b805b6862 (diff)
downloadmailman2-b8a931284d51365af2d14c1d7804cc8b7711b57f.tar.gz
mailman2-b8a931284d51365af2d14c1d7804cc8b7711b57f.tar.xz
mailman2-b8a931284d51365af2d14c1d7804cc8b7711b57f.zip
Fix pipermail.py bug for not retainning original date in .txt archive
if the archive was regenerated by 'arch --wipe'. Thanks SHIGENO san for reporting bug and essential fix. Code was rewritten for simplicity.
-rw-r--r--Mailman/Archiver/pipermail.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Mailman/Archiver/pipermail.py b/Mailman/Archiver/pipermail.py
index 173c5980..fac7e5ed 100644
--- a/Mailman/Archiver/pipermail.py
+++ b/Mailman/Archiver/pipermail.py
@@ -7,7 +7,7 @@ import os
import re
import sys
import time
-from email.Utils import parseaddr, parsedate_tz, mktime_tz
+from email.Utils import parseaddr, parsedate_tz, mktime_tz, formatdate
import cPickle as pickle
from cStringIO import StringIO
from string import lowercase
@@ -240,6 +240,9 @@ class Article:
date = self._last_article_time + 1
self._last_article_time = date
self.date = '%011i' % date
+ self.datestr = message.get('date') \
+ or message.get('x-list-received-date') \
+ or formatdate(date)
def __repr__(self):
return '<Article ID = '+repr(self.msgid)+'>'