[issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value

Abhilash Raj report at bugs.python.org
Sun Nov 26 19:03:08 EST 2017


New submission from Abhilash Raj <raj.abhilash1 at gmail.com>:

According to the documentation, email.policy.SMTP and .SMTPUTF8  should have CRLF (`\r\n`) as line endings for text/plain parts.

However, a new message parsed using message_from_binary_file with policy.SMTPUTF8 has `\n` as line endings for text/plain parts. This happens when I use get_content() on the new EmailMessage API.

Just to mention, in Python 2.7, the old `get_payload(decode=True)` returns the body with CRLF as line endings. However, in Python 3, `get_payload()` also returns '\n' as line endings.

Am I reading the documentation wrong?

----------
components: email
messages: 307029
nosy: barry, maxking, r.david.murray
priority: normal
severity: normal
status: open
title: email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32144>
_______________________________________


More information about the Python-bugs-list mailing list