You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
email.utils.getaddresses does not handle Header objects #71700
This appears to be something that was overlooked when btyes support was added in 3.2. getaddresses should indeed be able to handle a Header object if handed one.
changed the title [-]email.utils.getaddresses raises exception from erroneous message get_all input[/-][+]email.utils.getaddresses does not handle Header objects[/+]on Jul 14, 2016
New changeset 8c43bf1 by Miss Islington (bot) in branch '3.10': bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242) 8c43bf1
Activity
frispete commentedon Jul 14, 2016
An unfortunate combination of get_all and getaddresses results in a Traceback:
Here's the relevant part of it:
Content-type: text/html;charset=iso-8859-1
From: Itaú Uniclass. <comunicado.com.br@atendimento.gotdns.ch>
Obviously, the From header is iso-8859-1 encoded as well, and violates RFC 2822 as such. But making it crash in the usual combination of
isn't the real McCoy either..
frispete commentedon Jul 14, 2016
message.get cannot decode the header correctly, and returns a Header instance instead, which makes email.utils.getaddresses stumble upon...
A much better behavior for getaddresses in this case would be returning the perfectly valid address, and ignoring the invalid dtext part.
bitdancer commentedon Jul 14, 2016
This appears to be something that was overlooked when btyes support was added in 3.2. getaddresses should indeed be able to handle a Header object if handed one.
[-]email.utils.getaddresses raises exception from erroneous message get_all input[/-][+]email.utils.getaddresses does not handle Header objects[/+]ambv commentedon Jul 19, 2021
New changeset 89f4c34 by Zackery Spytz in branch 'main':
bpo-27513: email.utils.getaddresses() now handles Header objects (bpo-13797)
89f4c34
ambv commentedon Jul 19, 2021
New changeset 8c43bf1 by Miss Islington (bot) in branch '3.10':
bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242)
8c43bf1
ambv commentedon Jul 19, 2021
New changeset 9ee12cf by Miss Islington (bot) in branch '3.9':
bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (bpo-27245)
9ee12cf