[Patches] [ python-Patches-413766 ] Reimplementation of multifile.py

noreply@sourceforge.net noreply@sourceforge.net
Wed, 04 Apr 2001 11:06:38 -0700


Patches item #413766, was updated on 2001-04-04 11:06
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=413766&group_id=5470

Category: Modules
Group: None
Status: Open
Priority: 5
Submitted By: Geoffrey T. Dairiki (dairiki)
Assigned to: Nobody/Anonymous (nobody)
Summary: Reimplementation of multifile.py

Initial Comment:
This is a re-implementation of the stock multifile.py

The main changes:

1. Efficiency:

This version supports calling the read() method with an
argument.
(In many cases, I've found that reading a MultiFile
line by line
is just too slow --- remember multipart messages often
contain
large binary attachments.)

This version performs reads on the underlying input
stream in
larger chunks as well, and uses a regular expression
search to
search for separator lines.

2. Buglets fixed

The original version has a buglet regarding its
handling of the
newline which preceeds a separator line.  According to
RFC 2046,
section 5.1.1 the newline preceeding a separator is
part of the
separator, not part of the preceeding content.  The old
version
of multifile.py treats the newline as part of the
content.  Thus,
it introduces a spurious empty line at the end of each
content.

Matching of the separators:  RFC 2046, section 5.1.1
also states,
that if the beginning of a line matches the separator,
it is a
separator.  The old code ignores only trailing white
space when
looking for a separator line.  This code ignores
trailing anything
on the separator line.


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

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