Abhilash Raj <[email protected]> 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: [email protected]
... To: [email protected]
... 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 <[email protected]>
<https://bugs.python.org/issue36564>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com