R. David Murray added the comment:

Note, however, that python3 will compensate for this bug in the input, and 
register a defect for it:

>>> import email
>>> import email.policy
>>> msg = email.message_from_string('To: "=?gb18030?B?bWFpbGZvcnRlc3R0?=" 
>>> <[email protected]>\n\ntest body', policy=email.policy.default)
>>> print(msg)
To: "=?gb18030?B?bWFpbGZvcnRlc3R0?=" <[email protected]>

test body
>>> msg['To']
'mailfortestt <[email protected]>'
>>> msg['To'].defects
(InvalidHeaderDefect('encoded word inside quoted string',),)

----------
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

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

Reply via email to