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 cjw296
Recipients Sharebear, barry, christian.heimes, cjw296, loewis
Date 2009-03-05.13:06:52
SpamBayes Score 0.0023543823
Marked as misclassified No
Message-id <>
Okay, splitting this out a little. I've moved the exception when setting  
character set after adding parts out to [Issue5423].

Here's a simpler example of the problem with setting character sets on 

>>> from email.MIMEMultipart import MIMEMultipart
>>> msg = MIMEMultipart()
>>> msg.set_charset('iso-8859-15')
>>> print msg.as_string()
MIME-Version: 1.0
Content-Type: multipart/mixed; charset="iso-8859-15";
Content-Transfer-Encoding: quoted-printable

As a programmer, I don't think I've done anything wrong, but that mail 
is not valid and causes some fussy MTAs to barf and show the message as 

That said, when would you ever need or want to set the character set on 
a MIMEMultipart? I have this in my code, but I suspect I was just 
sheep/paranoia programming. When would just making set_charset on a 
MIMEMultipart raise an exception cause problems?
Date User Action Args
2009-03-05 13:06:55cjw296setrecipients: + cjw296, loewis, barry, christian.heimes, Sharebear
2009-03-05 13:06:55cjw296setmessageid: <>
2009-03-05 13:06:54cjw296linkissue1823 messages
2009-03-05 13:06:52cjw296create