1
0
mirror of https://github.com/django/django.git synced 2025-10-29 16:46:11 +00:00

[1.6.x] Fixed #19107 -- Restored bug fix for sending unicode email with Python 2.6.5 and below.

This commit is contained in:
Tim Graham
2014-07-30 09:28:43 -04:00
parent 8567c1a3c2
commit e4b2bea743
2 changed files with 5 additions and 0 deletions

View File

@@ -132,6 +132,8 @@ class MIMEMixin():
"""
fp = six.StringIO()
g = generator.Generator(fp, mangle_from_=False)
if sys.version_info < (2, 6, 6) and isinstance(self._payload, six.text_type):
self._payload = self._payload.encode(self._charset.output_charset)
g.flatten(self, unixfrom=unixfrom)
return fp.getvalue()