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

2017-11-30 Thread R. David Murray
R. David Murray added the comment: A note would be too heavy handed. And get_content is a different function from get_payload, so there is no change in behavior, there is a new API with a more consistent behavior. Basically, Python programs in general use \n line

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

2017-11-29 Thread Abhilash Raj
Abhilash Raj added the comment: Well, I myself missed the "serialization" part, so it probably was my mistake. Maybe a :note: saying line endings are only added in serialized outputs like the one obtained from `as_string()` or `as_bytes()` but not for other methods

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

2017-11-28 Thread R. David Murray
R. David Murray added the comment: OK, I should have used the term the docs actually use: "serialization". get_content() is, I hope, clearly not serialization, while as_string() is. Does that make it make more sense? Do you see a way to improve the docs in this

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

2017-11-27 Thread Abhilash Raj
Abhilash Raj added the comment: I understand that the line endings are meant for "outputs", but what constitutes as output in this case? I now see that `EmailMessage.as_string()` gives me `\r\n` as line endings and, which is probably what you mean by output and

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

2017-11-27 Thread R. David Murray
R. David Murray added the comment: Your are reading the documentation wrong. For linesep, it says "The string to be used to terminate lines in serialized output." The key word there is "output". email operates in "universal newline mode" when parsing messages,

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

2017-11-26 Thread Mark Sapiro
Change by Mark Sapiro : -- nosy: +msapiro ___ Python tracker ___ ___ Python-bugs-list

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

2017-11-26 Thread Abhilash Raj
New submission from Abhilash Raj : 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