diff options
| author | bwarsaw | 2002-08-29 17:23:32 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-08-29 17:23:32 +0000 |
| commit | 4579c83cbe931439a1501ca799ed0d3f82c25079 (patch) | |
| tree | fbd8bf5d704c55b108982fdf5f5a58d5bb629a76 | |
| parent | a554ebe6a034aa4b2f8d66d0f8c48eec427de347 (diff) | |
| download | mailman-4579c83cbe931439a1501ca799ed0d3f82c25079.tar.gz mailman-4579c83cbe931439a1501ca799ed0d3f82c25079.tar.zst mailman-4579c83cbe931439a1501ca799ed0d3f82c25079.zip | |
processUnixMailbox(): We don't need to catch MessageParseError since
the base class's .next() method will never raise them (it's factory
masks them). However, the end condition is now that "m is None"
instead of m being false.
| -rw-r--r-- | Mailman/Archiver/pipermail.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Mailman/Archiver/pipermail.py b/Mailman/Archiver/pipermail.py index 25a027528..2907a9915 100644 --- a/Mailman/Archiver/pipermail.py +++ b/Mailman/Archiver/pipermail.py @@ -6,7 +6,6 @@ import re import sys import time import email.Utils -import email.Errors import cPickle as pickle from cStringIO import StringIO from string import lowercase @@ -535,10 +534,7 @@ class T: m = mbox.next() except Errors.DiscardMessage: continue - except email.Errors.MessageParseError: - # Probably a missing terminating boundary - continue - if not m: + if m is None: return counter += 1 while 1: @@ -547,15 +543,15 @@ class T: m = mbox.next() except Errors.DiscardMessage: continue - except email.Errors.MessageParseError: - # Probably a missing terminating boundary - continue except Exception, e: syslog('error', 'uncaught archiver exception at filepos: %s', pos) raise - if not m: + if m is None: break + if m == '': + # It was an unparseable message + continue msgid = m.get('message-id', 'n/a') self.message(_('#%(counter)05d %(msgid)s')) a = articleClass(m, self.sequence) |
