[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()

View File

@ -30,3 +30,6 @@ Bugfixes
* Fixed the "ORA-01843: not a valid month" errors when using Unicode
with older versions of Oracle server
(`#20292 <https://code.djangoproject.com/ticket/20292>`_).
* Restored bug fix for sending unicode email with Python 2.6.5 and below
(`#19107 <https://code.djangoproject.com/ticket/19107>`_).