[issue32058] Faulty behaviour in email.utils.parseaddr if square brackets in subject

tom de wulf report at bugs.python.org
Fri Nov 17 06:06:43 EST 2017


New submission from tom de wulf <dewulfmail at gmail.com>:

Probably a parsing bug in email.utils.parseaddr.

How to recreate:

>>> import email.utils
>>> test = 'Subject: I am a bug [Random]\r\nFrom: someone <some at email.address>\r\n\r\n'
>>> email.utils.parseaddr(test)
('', 'I')
>>> email.utils.parseaddr(test.replace('[', '').replace(']',''))
('someone', 'some at email.address')

Expected behaviour: no need to remove the []'s

----------
components: email
messages: 306431
nosy: barry, r.david.murray, tom de wulf
priority: normal
severity: normal
status: open
title: Faulty behaviour in email.utils.parseaddr if square brackets in subject
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32058>
_______________________________________


More information about the Python-bugs-list mailing list