New submission from Jonathan Horn <jonathan.hor...@googlemail.com>:

I encountered a problem with replacing the 'Subject' header of an email. After 
serializing it again, the utf8 encoding was wrong. It seems to be occurring 
when folding the internal header objects.

Example:
>> email.policy.default.fold_binary('Subject', 
>> email.policy.default.header_store_parse('Subject', 'Hello Wörld! Hello 
>> Wörld! Hello Wörld! Hello Wörld!Hello Wörld!')[1])
Expected output: b'Subject: Hello 
=?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=\n Hello 
=?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=\n' (or similar)
Actual output: b'Subject: Hello 
=?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=\n Hello 
=?utf-8?=?utf-8?q?q=3FW=3DC3=3DB6rld!Hello=3F=3D_W=C3=B6rld!?=\n'

I'm running Python 3.7.3 on Arch Linux using Linux 5.0.

----------
components: email
messages: 339419
nosy: Jonathan Horn, barry, r.david.murray
priority: normal
severity: normal
status: open
title: Email header folded incorrectly
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36520>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to