bpoaugust <[email protected]> added the comment:

Sorry, I think '<[email protected] A.A>' is not valid, as spaces are not allowed between 
words.

However I am not seeing the original unfolded source if there is an error, 
unless I am misunderstanding the API.

For example:

--- cut here ---
import email.header
import email.utils
import email.policy

def test(test):
    msg_string = f"Message-id: {test}"
    message = email.message_from_string(msg_string, policy=email.policy.default)
    out = message['Message-id']
    print(test)
    print(out)

test('<[email protected] A.A>') # invalid
test('<[email protected]>') # valid
--- cut here ---

This produces:

<[email protected] A.A>
<[email protected]> # truncated at error
<[email protected]>
<[email protected]>

i.e. the invalid input is truncated

----------

_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46392>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to