Changes between Version 1 and Version 2 of Ticket #23063, comment 33
- Timestamp:
- Oct 9, 2014, 7:17:15 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23063, comment 33
v1 v2 15 15 raise 16 16 diff --git a/django/core/mail/message.py b/django/core/mail/message.py 17 index da9891f.. 57337aa10064417 index da9891f..63b0014 100644 18 18 --- a/django/core/mail/message.py 19 19 +++ b/django/core/mail/message.py … … 23 23 class MIMEMixin(): 24 24 - def as_string(self, unixfrom=False): 25 + def as_string(self, unixfrom=False, linesep= None):25 + def as_string(self, unixfrom=False, linesep='\n'): 26 26 """Return the entire formatted message as a string. 27 27 Optional `unixfrom' when True, means include the Unix From_ envelope 28 28 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 30 40 if six.PY2: 31 41 as_bytes = as_string … … 36 46 Optional `unixfrom' when True, means include the Unix From_ envelope 37 47 header. 38 @@ -149,7 +1 49,7 @@ class MIMEMixin():48 @@ -149,7 +152,7 @@ class MIMEMixin(): 39 49 """ 40 50 fp = six.BytesIO()