[New-bugs-announce] [issue35016] \r to match add into address header with not-ascii character

Ivan Krivosheev report at bugs.python.org
Thu Oct 18 05:38:34 EDT 2018


New submission from Ivan Krivosheev <py.krivosheev at 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'] = 'Юзер Один <user1 at example.com>'
    >>> print(msg.as_bytes())

On python 3.5 result:

    >>> b'To: =?utf-8?b?0K7Qt9C10YAg0J7QtNC40L0=?= <user1 at example.com>\r\n\r\n'


On python 3.6, python 3.7:

   >>> b'To:\r\n =?utf-8?b?0K7Qt9C10YAg0J7QtNC40L0=?= <user1 at 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 <report at bugs.python.org>
<https://bugs.python.org/issue35016>
_______________________________________


More information about the New-bugs-announce mailing list