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.

Author Sharebear
Recipients Sharebear
Date 2008-01-14.10:54:52
SpamBayes Score 0.0063971016
Marked as misclassified No
Message-id <1200308097.55.0.0363931421733.issue1822@psf.upfronthosting.co.za>
In-reply-to
Content
Steps to reproduce
==================
>>> from email.mime.multipart import MIMEMultipart
>>> foo = MIMEMultipart()
>>> foo.is_multipart()
False

Expected Result
===============
True should be returned from MIMEMultipart.is_multipart()

Notes
=====
Looking at the implementation of is_multipart() in email.Message it 
would appear that if self._payload was initialised to an empty list in 
the constructor of MIMEMultipart when _subparts is None, this would be 
a sufficient fix for this issue.

However, from an outsider looking into this code for the first time, 
this doesn't look like the best architecture, shouldn't the issue of 
whether a message has multiple parts, and logic specific to this be 
handled through inheritance. With the current implementation the 
superclass makes assumptions about how a subclass is implemented, this 
just feels wrong. Have I missed something, is there a good reason for 
things being as they are today?

Feel free to take the discussion to the python-dev list, I have just 
subscribed, and I am interested in fixing this issue myself in the next 
bug day if someone can answer my questions above.
History
Date User Action Args
2008-01-14 10:54:57Sharebearsetspambayes_score: 0.0063971 -> 0.0063971016
recipients: + Sharebear
2008-01-14 10:54:57Sharebearsetspambayes_score: 0.0063971 -> 0.0063971
messageid: <1200308097.55.0.0363931421733.issue1822@psf.upfronthosting.co.za>
2008-01-14 10:54:54Sharebearlinkissue1822 messages
2008-01-14 10:54:52Sharebearcreate