#3398: send_mass_mail confused by non-ascii characters
-----------------------+----------------------------------------------------
Reporter: anonymous | Owner: adrian
Status: new | Component: django.core.mail
Version: SVN | Keywords: unicode
Stage: Unreviewed | Has_patch: 1
-----------------------+----------------------------------------------------
send_mass_mail barfs with UnicodeEncodeError when handed a non-ascii
unicode instance, here's a q&d fix.
{{{
Index: mail.py
===================================================================
--- mail.py (wersja 4451)
+++ mail.py (kopia robocza)
@@ -50,6 +50,8 @@
if not recipient_list:
continue
from_email = from_email or settings.DEFAULT_FROM_EMAIL
+ if isinstance(message, unicode):
+ message = message.encode(settings.DEFAULT_CHARSET)
msg = SafeMIMEText(message, 'plain', settings.DEFAULT_CHARSET)
msg['Subject'] = subject
msg['From'] = from_email
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/3398>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---