Changes between Version 1 and Version 2 of Ticket #23063, comment 33


Ignore:
Timestamp:
10/09/14 12:17:15 (8 years ago)
Author:
Florian Apolloner
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23063, comment 33

    v1 v2  
    1515                 raise
    1616diff --git a/django/core/mail/message.py b/django/core/mail/message.py
    17 index da9891f..57337aa 100644
     17index da9891f..63b0014 100644
    1818--- a/django/core/mail/message.py
    1919+++ b/django/core/mail/message.py
     
    2323 class MIMEMixin():
    2424-    def as_string(self, unixfrom=False):
    25 +    def as_string(self, unixfrom=False, linesep=None):
     25+    def as_string(self, unixfrom=False, linesep='\n'):
    2626         """Return the entire formatted message as a string.
    2727         Optional `unixfrom' when True, means include the Unix From_ envelope
    2828         header.
    29 @@ -139,7 +139,7 @@ class MIMEMixin():
     29@@ -133,13 +133,16 @@ class MIMEMixin():
     30         """
     31         fp = six.StringIO()
     32         g = generator.Generator(fp, mangle_from_=False)
     33-        g.flatten(self, unixfrom=unixfrom)
     34+        if six.PY2:
     35+            g.flatten(self, unixfrom=unixfrom)
     36+        else:
     37+            g.flatten(self, unixfrom=unixfrom, linesep=linesep)
     38         return fp.getvalue()
     39 
    3040     if six.PY2:
    3141         as_bytes = as_string
     
    3646             Optional `unixfrom' when True, means include the Unix From_ envelope
    3747             header.
    38 @@ -149,7 +149,7 @@ class MIMEMixin():
     48@@ -149,7 +152,7 @@ class MIMEMixin():
    3949             """
    4050             fp = six.BytesIO()
Back to Top