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.

classification
Title: email: no way to add additional parameter to Content-Type
Type: enhancement Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, tlau
Priority: normal Keywords:

Created on 2004-11-23 05:19 by tlau, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg23252 - (view) Author: Tessa Lau (tlau) Date: 2004-11-23 05:19
The iCalendar specification (RFC 2445) requires that
iCalendar objects sent via MIME must include a method
parameter in the Content-Type header which mirrors the
method in the iCalendar object.  For example:

Content-Type: text/calendar; method="REQUEST";
charset="UTF-8"

Using Python's email package, it is impossible to
generate a MIMEText which has that method=REQUEST
parameter because the constructor does not allow for
arbitrary parameters, only the subtype and the charset.
msg23253 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-11-23 14:05
Logged In: YES 
user_id=12800

While the MIMEText constructor doesn't take a list of
parameters, you can easily add this after the fact by using
the set_param() method, e.g.:

m = MIMEText('foo', 'calendar', 'utf-8')
m.set_param('method', 'REQUEST')

or you can use the MIMEBase class instead of MIMEText.
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41208
2004-11-23 05:19:31tlaucreate