Author claudep
Recipients barry, claudep, r.david.murray
Date 2012-10-25.15:49:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351180172.93.0.972082460953.issue16324@psf.upfronthosting.co.za>
In-reply-to
Content
When initializing a MIMEText instance, it might be desirable to set the _charset parameter to a real Charset instance, not only a charset identifier (for example to pass a Charset with customized body_encoding). Unfortunately, this is failing:

  File ".../django/core/mail/message.py", line 128, in __init__
    MIMEText.__init__(self, text, subtype, charset)
  File "/usr/lib/python3.2/email/mime/text.py", line 29, in __init__
    **{'charset': _charset})
  File "/usr/lib/python3.2/email/mime/base.py", line 25, in __init__
    self.add_header('Content-Type', ctype, **_params)
  File "/usr/lib/python3.2/email/message.py", line 475, in add_header
    parts.append(_formatparam(k.replace('_', '-'), v))
  File "/usr/lib/python3.2/email/message.py", line 67, in _formatparam
    if value is not None and len(value) > 0:
TypeError: object of type 'Charset' has no len()

It is possible to later call set_charset, but the payload is already encoded (and 'Content-Transfer-Encoding' is set).
Did I miss anything?
History
Date User Action Args
2012-10-25 15:49:32claudepsetrecipients: + claudep, barry, r.david.murray
2012-10-25 15:49:32claudepsetmessageid: <1351180172.93.0.972082460953.issue16324@psf.upfronthosting.co.za>
2012-10-25 15:49:32claudeplinkissue16324 messages
2012-10-25 15:49:32claudepcreate