summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-09-27 20:04:43 +0000
committerbwarsaw2000-09-27 20:04:43 +0000
commitdc92b491038da118651d5ecdfbe9c5171b51305d (patch)
treeedca50b5d86fe4f4282ad5a66edcb0fb6f267905
parent96bbfb54c5d3a43017b254c38407de7c6266a72f (diff)
downloadmailman-dc92b491038da118651d5ecdfbe9c5171b51305d.tar.gz
mailman-dc92b491038da118651d5ecdfbe9c5171b51305d.tar.zst
mailman-dc92b491038da118651d5ecdfbe9c5171b51305d.zip
AppendMessage(): Since we can't portably test the numeric/symbolic
error code raised by seek()ing before the end of a non-existant or zero length file, we simply ignore all IOErrors that can result.
-rw-r--r--Mailman/Mailbox.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Mailman/Mailbox.py b/Mailman/Mailbox.py
index 4edad7e78..3eb47d6c3 100644
--- a/Mailman/Mailbox.py
+++ b/Mailman/Mailbox.py
@@ -40,8 +40,9 @@ class Mailbox(mailbox.UnixMailbox):
try:
self.fp.seek(-1, 2)
except IOError, e:
- if e.errno <> errno.EINVAL: raise
- # the file must be empty
+ # Assume the file is empty. We can't portably test the error code
+ # returned, since it differs per platform.
+ pass
else:
if self.fp.read(1) <> '\n':
self.fp.write('\n')