[Patches] [ python-Patches-880621 ] incorrect end-of-message handling in mailbox.BabylMailbox

SourceForge.net noreply at sourceforge.net
Sat Aug 21 14:31:09 CEST 2004


Patches item #880621, was opened at 2004-01-20 16:15
Message generated for change (Settings changed) made by jlgijsbers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=880621&group_id=5470

Category: Library (Lib)
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: KAJIYAMA, Tamito (kajiyama)
>Assigned to: Johannes Gijsbers (jlgijsbers)
Summary: incorrect end-of-message handling in mailbox.BabylMailbox

Initial Comment:
The mailbox.BabylMailbox class does not handle end of
message correctly.
The last message in a mailbox ends in '\037' instead of
'\037\014\n'
(i.e. FF and LF do not exist at the end of the
mailbox).  However, the
class in question does not take this special case into
account, so that
application programs get '\037' as the last line of the
last message.
Following is a simple fix of this bug:

--- mailbox.py.orig	Tue Jan 20 23:10:32 2004
+++ mailbox.py	Tue Jan 20 23:08:17 2004
@@ -263,7 +263,7 @@
             line = self.fp.readline()
             if not line:
                 return
-            if line == '\037\014\n':
+            if line == '\037\014\n' or line == '\037':
                 self.fp.seek(pos)
                 return

The bug is in Python 2.3.3 and probably all of older
versions.

----------------------------------------------------------------------

>Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-08-21 14:31

Message:
Logged In: YES 
user_id=469548

Checked in as  rev 1.44 of mailbox.py. Thanks for the patch!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=880621&group_id=5470


More information about the Patches mailing list