Steffen Daode Nurpmeso <sdao...@googlemail.com> added the comment:

On Fri, Apr 08, 2011 at 11:39:36PM +0000, Terry J. Reedy wrote:
> 1. What is a minimal msgdata that gives the same error; post it.

Stepping a bit..  Remove 'Content-Type' header field and this does 
not crash.  Thus the real problem may again lie in get_payload() 
trying to convert data instead of leaving it alone. 
I'll try to instrument the path a bit ..

import email, email.parser, email.generator, io, textwrap
msgdata = textwrap.dedent("""\
            Date: Mon, 01 Feb 2010 12:21:16 +0100
            From: "three" <f...@example.net>
            To: <o...@two.com>
            Subject: Content-Type crash
            Content-Type: message/rfc822

            Remove Content-Type header field and no crash happens!
        """).encode('ascii')
msg = email.parser.BytesParser().parsebytes(msgdata, headersonly=True)
email.generator.BytesGenerator(io.BytesIO()).flatten(msg)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to