diff options
| author | Barry Warsaw | 2009-02-07 23:14:26 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-02-07 23:14:26 -0500 |
| commit | 84a81e4a90349f7116863d2f45cda1ee31b5b3b5 (patch) | |
| tree | 9f9d809613f35a2a2757dc623b2c7a7924d55e30 /src/mailman/Archiver/pipermail.py | |
| parent | a0e24e42813198dab691d2a4d67ee6a6a0f7b084 (diff) | |
| parent | 4c6c95a847f440242e9133a39f0b96a5d7a9d4e3 (diff) | |
| download | mailman-84a81e4a90349f7116863d2f45cda1ee31b5b3b5.tar.gz mailman-84a81e4a90349f7116863d2f45cda1ee31b5b3b5.tar.zst mailman-84a81e4a90349f7116863d2f45cda1ee31b5b3b5.zip | |
Diffstat (limited to 'src/mailman/Archiver/pipermail.py')
| -rw-r--r-- | src/mailman/Archiver/pipermail.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mailman/Archiver/pipermail.py b/src/mailman/Archiver/pipermail.py index 19bc05c3f..e6c87baa0 100644 --- a/src/mailman/Archiver/pipermail.py +++ b/src/mailman/Archiver/pipermail.py @@ -17,7 +17,6 @@ __version__ = '0.11 (Mailman edition)' VERSION = __version__ CACHESIZE = 100 # Number of slots in the cache -from mailman.Mailbox import ArchiverMailbox from mailman.core import errors from mailman.i18n import _ @@ -540,30 +539,29 @@ class T: def _makeArticle(self, msg, sequence): return Article(msg, sequence) - def processUnixMailbox(self, input, start=None, end=None): - mbox = ArchiverMailbox(input, self.maillist) + def processUnixMailbox(self, path, start=None, end=None): + mbox = iter(mailbox.mbox(path)) if start is None: start = 0 counter = 0 while counter < start: try: - m = mbox.next() + m = next(mbox) except errors.DiscardMessage: continue if m is None: return counter += 1 - while 1: + while True: try: - pos = input.tell() - m = mbox.next() + m = next(mbox) + except StopIteration: + break except errors.DiscardMessage: continue except Exception: - log.error('uncaught archiver exception at filepos: %s', pos) + log.error('uncaught archiver exception') raise - if m is None: - break if m == '': # It was an unparseable message continue |
