[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

Abhilash Raj report at bugs.python.org
Fri May 17 10:15:27 EDT 2019


Abhilash Raj <raj.abhilash1 at gmail.com> added the comment:

I was wrong about the parsing error, it looks like length from the policy isn't used when parsing.

>>> from email.policy import default
>>> from email import message_from_string
>>> p = default.clone(max_line_length=10)
>>> msg = message_from_string("""\
... From: Hello at example.com
... To: Hello at example.com
... Subject: WelcomeToThisLongSubject
... 
... Thanks""", policy=p)
>>> msg
<email.message.EmailMessage object at 0x7f448f70d860>
>>> msg['Subject']
'WelcomeToThisLongSubject'


This works just fine. Thanks David. +1 for ValueError then.

----------

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


More information about the Python-bugs-list mailing list