[ python-Bugs-846938 ] email.Parser.Parser doesn't check for valid Content-Type

SourceForge.net noreply at sourceforge.net
Thu May 13 18:30:07 EDT 2004


Bugs item #846938, was opened at 2003-11-21 17:25
Message generated for change (Comment added) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=846938&group_id=5470

Category: Python Library
>Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason R. Mastaler (jasonrm)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: email.Parser.Parser doesn't check for valid Content-Type

Initial Comment:
See the attached traceback illustrating how to
reproduce the
problem.  A sample triggering message is also attached.

The problem is that the Content-Type is 'multipour
alternative', 
but the Content-Type field has a valid 'boundary='
parameter. 
The parser doesn't check that Content-Type is valid; it
just creates
sub-Message objects for each part it finds that is
separated by the 
boundary.  Then, when Generator goes to check
Content-Type, it
discovers that the content-type *is* invalid and it
returns 
'text/plain' instead! Generator tries to _handle_text
and instead
 finds the list of sub-Message objects.  BOOM!


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

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2004-05-13 18:30

Message:
Logged In: YES 
user_id=12800

This is going to be difficult to fix in email 2.5.  Can you
try the new parser in email3/Python 2.4cvs?  It doesn't fail
on this message.


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

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



More information about the Python-bugs-list mailing list