From dc92b491038da118651d5ecdfbe9c5171b51305d Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Wed, 27 Sep 2000 20:04:43 +0000 Subject: 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. --- Mailman/Mailbox.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Mailman/Mailbox.py') 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') -- cgit v1.2.3-70-g09d2