[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread Abhilash Raj


Abhilash Raj  added the comment:

Thanks Mark!

--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread Abhilash Raj


Abhilash Raj  added the comment:

Closing this since the PRs for the behavior change reported by Mike and 
BPO-41206 is now merged too.

--
nosy: +maxking
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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset e68978978f49cfc489fa0f888281ce84460818c0 by Miss Islington (bot) 
in branch '3.9':
bpo-40597: Allow email.contextmanager set_content() to set a null string. 
(GH-20542)
https://github.com/python/cpython/commit/e68978978f49cfc489fa0f888281ce84460818c0


--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset c1c50345933efca42169f03d79ff4fe3d9c06bdc by Miss Islington (bot) 
in branch '3.8':
bpo-40597: Allow email.contextmanager set_content() to set a null string. 
(GH-20542)
https://github.com/python/cpython/commit/c1c50345933efca42169f03d79ff4fe3d9c06bdc


--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20553
pull_request: https://github.com/python/cpython/pull/21404

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20554
pull_request: https://github.com/python/cpython/pull/21405

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset 4fa61a7732923f92de0f7830c12da48c4cec937f by Mark Sapiro in branch 
'master':
bpo-40597: Allow email.contextmanager set_content() to set a null string. 
(GH-20542)
https://github.com/python/cpython/commit/4fa61a7732923f92de0f7830c12da48c4cec937f


--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-30 Thread Mark Sapiro


Change by Mark Sapiro :


--
pull_requests: +19786
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/20542

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-30 Thread Mark Sapiro


Mark Sapiro  added the comment:

With the fix in PR 20038, committed at 
https://github.com/python/cpython/commit/6f2f475d5a2cd7675dce844f3af436ba919ef92b
 it is no longer possible to set_content(''). Attempts to do so produce the 
following
```
  File 
"/var/MM/3/hk_39/hyperkitty/.tox/py39-django30/lib/python3.9/site-packages/django_mailman3/lib/scrub.py",
 line 95, in _get_all_attachments
part.set_content('')
  File "/usr/local/lib/python3.9/email/message.py", line 1171, in set_content
super().set_content(*args, **kw)
  File "/usr/local/lib/python3.9/email/message.py", line 1101, in set_content
content_manager.set_content(self, *args, **kw)
  File "/usr/local/lib/python3.9/email/contentmanager.py", line 37, in 
set_content
handler(msg, obj, *args, **kw)
  File "/usr/local/lib/python3.9/email/contentmanager.py", line 185, in 
set_text_content
cte, payload = _encode_text(string, charset, cte, msg.policy)
  File "/usr/local/lib/python3.9/email/contentmanager.py", line 149, in 
_encode_text
if max(len(x) for x in lines) <= policy.max_line_length:
ValueError: max() arg is an empty sequence
```

--
nosy: +msapiro

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-17 Thread R. David Murray


Change by R. David Murray :


--
stage: backport needed -> resolved

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-17 Thread R. David Murray


R. David Murray  added the comment:


New changeset c1f1ddf30a595c2bfa3c06e54fb03fa212cd28b5 by Miss Islington (bot) 
in branch '3.8':
bpo-40597: email: Use CTE if lines are longer than max_line_length consistently 
(gh-20038) (gh-20084)
https://github.com/python/cpython/commit/c1f1ddf30a595c2bfa3c06e54fb03fa212cd28b5


--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-13 Thread R. David Murray


R. David Murray  added the comment:

Thanks, Arkadiusz.

--
resolution:  -> fixed
stage: patch review -> backport needed
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-13 Thread R. David Murray


R. David Murray  added the comment:


New changeset 6f2f475d5a2cd7675dce844f3af436ba919ef92b by Arkadiusz Hiler in 
branch 'master':
bpo-40597: email: Use CTE if lines are longer than max_line_length consistently 
(gh-20038)
https://github.com/python/cpython/commit/6f2f475d5a2cd7675dce844f3af436ba919ef92b


--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +19388
pull_request: https://github.com/python/cpython/pull/20084

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-11 Thread R. David Murray


R. David Murray  added the comment:

The PR looks good to me, but I describe the change differently.  I'm not sure 
how I missed this in the original implementation, since I obviously checked it 
for the 8bit case.  Too long ago to remember :)

--

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-11 Thread Arkadiusz Hiler


Change by Arkadiusz Hiler :


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

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-11 Thread Arkadiusz Hiler


New submission from Arkadiusz Hiler :

RFC5322[0] in section 2.1.1 mandates that the line cannot be longer than 998 
characters and should not be longer than 78 characters (excluding CRLF). When 
we use raw_data_manager (default for EmailPolicy, EmailMessage) it does the 
correct thing as long as the message contains characters outside of 7bit 
US-ASCII set - base64 or qp Content-Transfer-Encoding which respects the line 
wrapping at 78 characters.

However if our message is limited the characters from the 7bit US-ASCII set no 
transfer encoding is applied, and such messages can easily go beyond 78 or even 
998 characters.


[0]: https://tools.ietf.org/html/rfc5322.html#section-2.1.1

--
components: email
messages: 368641
nosy: barry, ivyl, r.david.murray
priority: normal
severity: normal
status: open
title: generated email message exceeds RFC-mandated limit of 998 characters
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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