Commit f910eaf1 authored by Barry Warsaw's avatar Barry Warsaw

__init__(): Don't add a newline to _text if it doesn't already end in

one.  Possibly controversial.
parent be85340c
...@@ -17,8 +17,7 @@ class MIMEText(MIMENonMultipart): ...@@ -17,8 +17,7 @@ class MIMEText(MIMENonMultipart):
_encoder=None): _encoder=None):
"""Create a text/* type MIME document. """Create a text/* type MIME document.
_text is the string for this message object. If the text does not end _text is the string for this message object.
in a newline, one is added.
_subtype is the MIME sub content type, defaulting to "plain". _subtype is the MIME sub content type, defaulting to "plain".
...@@ -35,8 +34,6 @@ class MIMEText(MIMENonMultipart): ...@@ -35,8 +34,6 @@ class MIMEText(MIMENonMultipart):
""" """
MIMENonMultipart.__init__(self, 'text', _subtype, MIMENonMultipart.__init__(self, 'text', _subtype,
**{'charset': _charset}) **{'charset': _charset})
if _text and not _text.endswith('\n'):
_text += '\n'
self.set_payload(_text, _charset) self.set_payload(_text, _charset)
if _encoder is not None: if _encoder is not None:
warnings.warn('_encoder argument is obsolete.', warnings.warn('_encoder argument is obsolete.',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment