New submission from Ivan Krivosheev <py.krivosh...@gmail.com>: When convert email.message.Message to bytes, into header with non-ascii character in address add to match *\r* symbol.
Simple script for reproduce problem: >>> from email.message import Message >>> from email.policy import SMTP >>> msg = Message(policy=SMTP) >>> msg['To'] = 'Юзер Один <us...@example.com>' >>> print(msg.as_bytes()) On python 3.5 result: >>> b'To: =?utf-8?b?0K7Qt9C10YAg0J7QtNC40L0=?= <us...@example.com>\r\n\r\n' On python 3.6, python 3.7: >>> b'To:\r\n =?utf-8?b?0K7Qt9C10YAg0J7QtNC40L0=?= <us...@example.com>\r\r\r\r\r\n\r\n' ---------- components: email files: email1.py messages: 327950 nosy: barry, ikrivosheev, r.david.murray priority: normal severity: normal status: open title: \r to match add into address header with not-ascii character type: behavior versions: Python 3.6, Python 3.7 Added file: https://bugs.python.org/file47878/email1.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35016> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com