[Python-bugs-list] [ python-Bugs-667931 ] BoundaryError: multipart message with no defined boundary

SourceForge.net noreply@sourceforge.net
Mon, 19 May 2003 13:01:50 -0700


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

Category: Python Library
Group: Python 2.3
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Jason R. Mastaler (jasonrm)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: BoundaryError: multipart message with no defined boundary

Initial Comment:
More problems with the email package raising
exceptions when trying to parse non-compliant
messages.

Even when lax parsing is enabled, a BoundaryError
is raised when trying to parse the attached spam
message.

I'd like to see some sort of workaround to handle these
cases more gracefully when when lax parsing is
enabled.

This behavior seems like 'strict' parsing behavior to me.



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

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-05-19 16:01

Message:
Logged In: YES 
user_id=12800

Closing as per jasonrm's last update.

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

Comment By: Jason R. Mastaler (jasonrm)
Date: 2003-04-27 00:53

Message:
Logged In: YES 
user_id=85984

Ok, I see now.  I ended up replacing use 
of email.message_from_file() with my own  
implementation based upon email.Parser.HeaderParser. 
 
HeaderParser completely slipped past me.  I might 
suggest noting it a bit more prominently in the docs, 
perhaps in 2.2.1 under the description of the Parser 
class.  Even if there's some redundancy, it will help 
bring HeaderParser to the attention of more programmers. 
 
You can close this one out, thanks. 

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

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-04-26 21:49

Message:
Logged In: YES 
user_id=12800

HeaderParser is a parser that stops after reading just the
rfc 2822 headers, leaving the entirety of the body of the
message as one big text payload.

Sometimes that's the best you can do.

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

Comment By: Jason R. Mastaler (jasonrm)
Date: 2003-04-26 15:17

Message:
Logged In: YES 
user_id=85984

I'm unclear what you mean by: 
 
``You can always fall back to email.Header.HeaderParser  
when all else fails'' 
 

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

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-03-06 01:31

Message:
Logged In: YES 
user_id=12800

I see what you're saying, Jason, but I don't know how Parser
could do much better.  You can always fall back to
email.Header.HeaderParser when all else fails (well all else
modulo severely broken headers).


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

Comment By: Jason R. Mastaler (jasonrm)
Date: 2003-02-20 14:33

Message:
Logged In: YES 
user_id=85984

As Python 2.3a2 was just released, I'm worried that
this one is going to fall through the cracks before
2.3-final is released which would be unfortunate because
it would mean I'd have to continue bundling my own
copy of email with my applications.


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

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