This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: BoundaryError: multipart message with no defined boundary
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, jasonrm
Priority: low Keywords:

Created on 2003-01-14 18:36 by jasonrm, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
spam.txt jasonrm, 2003-01-14 18:37
exception.txt jasonrm, 2003-01-14 18:38
Messages (7)
msg14056 - (view) Author: Jason R. Mastaler (jasonrm) Date: 2003-01-14 18:36
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.

msg14057 - (view) Author: Jason R. Mastaler (jasonrm) Date: 2003-02-20 19:33
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.
msg14058 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2003-03-06 06:31
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).
msg14059 - (view) Author: Jason R. Mastaler (jasonrm) Date: 2003-04-26 19:17
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'' 
 
msg14060 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2003-04-27 01:49
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.
msg14061 - (view) Author: Jason R. Mastaler (jasonrm) Date: 2003-04-27 04:53
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. 
msg14062 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2003-05-19 20:01
Logged In: YES 
user_id=12800

Closing as per jasonrm's last update.
History
Date User Action Args
2022-04-10 16:06:08adminsetgithub: 37770
2003-01-14 18:36:53jasonrmcreate