On 12/29/2017 09:51 AM, Mark Sapiro wrote:
> 
> It looks like we have a bug somewhere. There may be a defective message
> in the .mbox, but even so, it should result in a more graceful error report.
> 
> Did you get a traceback with the "unexpected keyword argument"
> exception. I would like to see a traceback and if possible, the
> offending message.


Never mind. The use of the flags= argument in re.sub was introduced in
Mailman 2.1.22 and requires Python 2.7.

The exception will occur with Python older than 2.7.x when attempting to
archive a message with no valid Date: header and no valid
X-List-Received-Date: header.

I have updated the FAQs at <https://wiki.list.org/x/4030629> and
<https://wiki.list.org/x/876> to note this requirement.

I have also attached a patch to Mailman/Archiver/pipermail.py that will
allow it to work with older Python.

-- 
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

=== modified file 'Mailman/Archiver/pipermail.py'
--- Mailman/Archiver/pipermail.py	2016-05-12 18:54:42 +0000
+++ Mailman/Archiver/pipermail.py	2017-12-29 20:23:10 +0000
@@ -249,8 +249,8 @@
         if date is None:
             date = floatdate(message.get('x-list-received-date'))
         if date is None:
-            date = floatdate(re.sub(r'^.*;\s*', '',
-                                    message.get('received', ''), flags=re.S))
+            rec_re = re.compile(r'^.*;\s*', re.DOTALL)
+            date = floatdate(rec_re.sub('', message.get('received', '')))
         if date is None:
             date = floatdate(re.sub(r'From \s*\S+\s+', '',
                                     message.get_unixfrom() or '' ))


------------------------------------------------------
Mailman-Users mailing list [email protected]
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to