[Mailman-Users] Archiving failure
Dan Mick
Dan.Mick at west.sun.com
Sat Oct 28 21:05:41 CEST 2000
tim at maths.tcd.ie wrote:
>
> Our mailman system (running under FreeBSD) states (untruly) that every archives is empty,
> because -- I think -- it fails to write out the required index.html files.
>
> We get this (repeatedly) in ~mailman/logs/error
>
> ===============================================
> Oct 28 15:40:07 2000 (47279) Archive file access failure:
> /local/lib/mailman/archives/private/sf.mbox/sf.mbox (0, 'Error')
> Oct 28 15:40:07 2000 (47279) Delivery exception: (0, 'Error')
> Oct 28 15:40:07 2000 (47279) Traceback (innermost last):
> File "/local/lib/mailman/Mailman/Handlers/HandlerAPI.py", line 82, in do_pipeline
> func(mlist, msg, msgdata)
> File "/local/lib/mailman/Mailman/Handlers/ToArchive.py", line 47, in process
> mlist.ArchiveMail(msg, msgdata)
> File "/local/lib/mailman/Mailman/Archiver/Archiver.py", line 189, in ArchiveMail
> self.__archive_to_mbox(msg)
> File "/local/lib/mailman/Mailman/Archiver/Archiver.py", line 160, in __archive_to_mbox
> mbox.AppendMessage(post)
> File "/local/lib/mailman/Mailman/Mailbox.py", line 41, in AppendMessage
> self.fp.seek(-1, 2)
> IOError: (0, 'Error')
> ===============================================
Error number 0? That's an odd one...any way of using, what is it, ktrace,
to find out what that seek call is really returning to Python?
> Looking at ~mailman/Mailman/Mailbox.py the offending line
> seems to be the seek(-1,2) in the following,
> which appears to be an (odd) way of testing if the file is empty.
Well, I think it's a way of seeking the file backward one character; iff it
fails, the file must have been empty.
> ===============================================
> # msg should be an rfc822 message or a subclass.
> def AppendMessage(self, msg):
> # Check the last character of the file and write a newline if it isn't
> # a newline (but not at the beginning of an empty file.
> try:
> self.fp.seek(-1, 2)
> except IOError, e:
> if e.errno <> errno.EINVAL: raise
> # the file must be empty
This is an out-of-date version of Mailbox.py; upgrade to RC1. The issue's
been resolved.
> else:
> if self.fp.read(1) <> '\n':
> self.fp.write('\n')
> # seek to the last char of the mailbox
> self.fp.seek(1, 2)
> ===============================================
>
> I don't know anything about python --
> maybe appearing in logs/error is not that bad?
>
> Any suggestions of advice gratefully received.
>
> ------------------------------------------------------
> Mailman-Users maillist - Mailman-Users at python.org
> http://www.python.org/mailman/listinfo/mailman-users
More information about the Mailman-Users
mailing list