From 5326d6b9d132f23acfe1d79cfbd9793e9aa4a3a4 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Mon, 12 Dec 2011 17:31:32 -0800 Subject: Fixed an erroneous seek in the Mailman.Mailbox.Mailbox.AppendMessage method that could cause a corrupt mailbox for files opened 'w+'. Bug #901957. --- Mailman/Mailbox.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Mailman') diff --git a/Mailman/Mailbox.py b/Mailman/Mailbox.py index 1b281a4c..a7e8cced 100644 --- a/Mailman/Mailbox.py +++ b/Mailman/Mailbox.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2011 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,7 +12,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Extend mailbox.UnixMailbox. """ @@ -63,7 +64,7 @@ class Mailbox(mailbox.PortableUnixMailbox): if self.fp.read(1) <> '\n': self.fp.write('\n') # Seek to the last char of the mailbox - self.fp.seek(1, 2) + self.fp.seek(0, 2) # Create a Generator instance to write the message to the file g = Generator(self.fp) g.flatten(msg, unixfrom=True) -- cgit v1.2.3