diff -r c74c412031bb Lib/email/mime/multipart.py --- a/Lib/email/mime/multipart.py Sat Jan 19 11:48:13 2008 +0100 +++ b/Lib/email/mime/multipart.py Sat Jan 19 12:32:14 2008 +0100 @@ -34,6 +34,12 @@ class MIMEMultipart(MIMEBase): keyword arguments (or passed into the _params argument). """ MIMEBase.__init__(self, 'multipart', _subtype, **_params) + + # Initialise _payload to an empty list as the Message superclass's + # implementation of is_multipart assumes that _payload is a list for + # multipart messages. + self._payload = [] + if _subparts: for p in _subparts: self.attach(p) diff -r c74c412031bb Lib/email/test/test_email.py --- a/Lib/email/test/test_email.py Sat Jan 19 11:48:13 2008 +0100 +++ b/Lib/email/test/test_email.py Sat Jan 19 12:27:03 2008 +0100 @@ -1861,6 +1861,9 @@ message 2 eq(msg.get_payload(0), text1) eq(msg.get_payload(1), text2) + def test_default_multipart_constructor(self): + msg = MIMEMultipart() + self.assertTrue(msg.is_multipart()) # A general test of parser->model->generator idempotency. IOW, read a message