This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jwilk
Recipients barry, cnicodeme, jwilk, r.david.murray
Date 2018-07-19.21:03:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532034218.31.0.56676864532.issue34155@psf.upfronthosting.co.za>
In-reply-to
Content
You should not use decode_header() on the whole From header, because that loses
information. You should parse the header first, then decode the parts that
could be RFC2047-encoded.

Quoting <https://tools.ietf.org/html/rfc2047#section-6.2>:

> NOTE: Decoding and display of encoded-words occurs *after* a
> structured field body is parsed into tokens.  It is therefore
> possible to hide 'special' characters in encoded-words which, when
> displayed, will be indistinguishable from 'special' characters in the
> surrounding text.  For this and other reasons, it is NOT generally
> possible to translate a message header containing 'encoded-word's to
> an unencoded form which can be parsed by an RFC 822 mail reader.

So I don't see a bug in parseaddr() here, except that the API is a bit of a
footgun.
History
Date User Action Args
2018-07-19 21:03:38jwilksetrecipients: + jwilk, barry, r.david.murray, cnicodeme
2018-07-19 21:03:38jwilksetmessageid: <1532034218.31.0.56676864532.issue34155@psf.upfronthosting.co.za>
2018-07-19 21:03:38jwilklinkissue34155 messages
2018-07-19 21:03:38jwilkcreate