Is this a mimetools/rfc822 bug?

Andy andy at
Mon Jun 25 21:09:16 CEST 2001

samplemsg="""Date: Fri, 04 May 2001 14:29:01 +0200
From: Lars Degerstedt <lars.degerstedt at>
To: java-linux <java-linux at>
Subject: Stacktraces without line numbering?
Message-ID: <3AF2A08D.9C4ACF38 at>
Content-Type: multipart/mixed;

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Blah Blah
Content-Type: text/x-vcard; charset=us-ascii;
Content-Transfer-Encoding: 7bit
Content-Description: Card for Lars Degerstedt
Content-Disposition: attachment;

blah blah

import StringIO, mimetools

print email.gettype()

works fine.  But when there are leading newlines in samplemsg, it can't read
the headers anymore.  (Of course, you can always use lstrip... but it took
me a while before I found out - not a typical Python experience...)

More information about the Python-list mailing list