[issue41206] behaviour change with EmailMessage.set_content

2020-07-08 Thread Abhilash Raj


Abhilash Raj  added the comment:

I have merged https://github.com/python/cpython/pull/20542 and backported to 
3.8 and 3.9 branches (https://github.com/python/cpython/pull/21404 & 
https://github.com/python/cpython/pull/21405).

Closing this issue.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-07 Thread R. David Murray


R. David Murray  added the comment:

I'm short of time, if someone could approve Mark's PR and merge it it would be 
great. There wasn't supposed to be any behavior change other than the one 
documented in #40597.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Łukasz, There is already a PR open for this from May linking to original issue 
at https://github.com/python/cpython/pull/20542 . I missed it during triaging 
this issue. I guess someone needs to approve that PR and merge it to master to 
backport to 3.9 and 3.8 to fix the error.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
keywords: +patch
pull_requests: +20495
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21349

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Łukasz Langa

Łukasz Langa  added the comment:

Yes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There is a behavior change with my fix. 7bit is returned for 
Content-Transfer-Encoding before commit and skipping the heuristic if line is 
empty to avoid ValueError will return quoted-printable for 
Content-Transfer-Encoding. This is a behavior change even if the ValueError is 
fixed. I would like to confirm which is the correct behavior and to be 
documented appropriately.

Test Case in test_contentmanager.py : 

def test_set_text_plain_empty_content_heuristics(self):
m = self._make_message()
content = ""
raw_data_manager.set_content(m, content)
self.assertEqual(str(m), textwrap.dedent("""\   
  
Content-Type: text/plain; charset="utf-8"   
  
Content-Transfer-Encoding: quoted-printable 
  

  

  
"""))
self.assertEqual(m.get_payload(decode=True).decode('utf-8'), "\n")
self.assertEqual(m.get_content(), "\n")

--
nosy: +maxking

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sure, I guess the fix would be to check for lines to be non-empty before doing 
a call to max and also convert the report as a test case?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Łukasz Langa

Łukasz Langa  added the comment:

Good catch!

No need to revert anything. The raised ValueError is a relatively simple thing 
to fix. xtreak, mind making a follow-up PR to restore behavior with no \n 
characters?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Matthias Klose


Matthias Klose  added the comment:

that's a regression for the 3.8 branch, marking as a release blocker for 3.8.4. 
 This should be a documented change for 3.9, and probably reverted/fixed for 
3.8.

--
keywords: +3.8regression, 3.9regression
nosy: +doko, lukasz.langa
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-06 Thread Matthias Klose


Change by Matthias Klose :


--
nosy: +ivyl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-03 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is caused due to c1f1ddf30a595c2bfa3c06e54fb03fa212cd28b5 introduced as 
part of bpo-40597 which is reported back in the issue with 
https://bugs.python.org/msg370395

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41206] behaviour change with EmailMessage.set_content

2020-07-03 Thread David Bremner


New submission from David Bremner :

Works in 3.8.3, but not in 3.8.4rc1

from email.message import EmailMessage
msg = EmailMessage()
msg.set_content("")

Apparently now at least one newline is required.

--
components: email
messages: 372971
nosy: barry, bremner, r.david.murray
priority: normal
severity: normal
status: open
title: behaviour change with EmailMessage.set_content
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com