New submission from Константин Волков:

There is strange thing with long headers serialized, they have \n prefix. 
Example fails on Python3.4/3.5:

from email.message import Message
from email import message_from_bytes

x = '<147672320775.19544.6718708004153358...@mkren-spb.root.devdomain.local>'
header = 'Message-ID'
msg = Message()
msg[header] = x

data = msg.as_bytes()

msg2 = message_from_bytes(data)
assert msg2[header] == x

MessageID was generated by email.utils.make_msgid function.

components: email
messages: 278820
nosy: barry, r.david.murray, Константин Волков
priority: normal
severity: normal
status: open
title: Email long headers parsing/serialization
versions: Python 3.4, Python 3.5

Python tracker <>
Python-bugs-list mailing list

Reply via email to