"CVR" == Chuq Von Rospach <chuqui@plaidworks.com> writes:
CVR> ack! it looks like my server is broken!
CVR> Things are dying attempting to write the mbox files in the
CVR> archiver:
CVR> Sep 26 10:35:03 2000 (32215) Archive file access failure:
CVR> /home/mailman/archives/private/sharks.mbox/sharks.mbox [Errno
CVR> 75] Value too large for defined data type Sep 26 10:35:03
CVR> 2000 (32215) Delivery exception: [Errno 75] Value too large
CVR> for defined data type Sep 26 10:35:03 2000 (32215) Traceback
CVR> (innermost last):
CVR> File "/home/mailman/Mailman/Handlers/HandlerAPI.py", line
CVR> 82, in do_pipeline func(mlist, msg, msgdata) File
CVR> "/home/mailman/Mailman/Handlers/ToArchive.py", line 47, in
CVR> process mlist.ArchiveMail(msg, msgdata) File
CVR> "/home/mailman/Mailman/Archiver/Archiver.py", line 189, in
CVR> ArchiveMail self.__archive_to_mbox(msg) File
CVR> "/home/mailman/Mailman/Archiver/Archiver.py", line 160, in
CVR> __archive_to_m
CVR> box
CVR> mbox.AppendMessage(post) File
CVR> "/home/mailman/Mailman/Mailbox.py", line 41, in AppendMessage
CVR> self.fp.seek(-1, 2)
CVR> IOError: [Errno 75] Value too large for defined data type
CVR> Barry? has this code been tested against a non-existant mbox
CVR> file? It seems to be failing.
Yep, but this could be a cross-platform issue.
What platform are you running on? For me on Linux RedHat 6.1, when I try to see past the end of a non-existant or zero length file, I get an EINVAL (errcode 22), which Mailbox.AppendMessage() should catch and ignore. If your error numbers are the same as mine, you're getting an EOVERFLOW, but why? What does "Value too large for defined data type" mean? Maybe that's just your platform's way of saying "Hey ya big dummy, you can't seek to before the end of a non-existing file!".
If that's the case, changing line 43 to
if e.errno not in (errno.EINVAL, errno.EOVERFLOW): raise
should do the trick. But be sure errno 75 == EOVERFLOW by doing:
% python
python -c "import errno; print errno.errorcode[75]"
I just tested this on a FreeBSD system I have available and the resulting error isn't EINVAL /or/ EOVERFLOW, it's an error code 0, which makes no sense!
Maybe Mailbox.AppendMessage() should simply discard any IOError it gets?
...
try:
self.fp.seek(-1, 2)
except IOError, e:
pass
# the file must be empty
...
? -Barry