[New-bugs-announce] [issue29678] email.Message.get_params decodes only first one header value

Sergey report at bugs.python.org
Tue Feb 28 13:32:28 EST 2017


New submission from Sergey:

email.Message class has method get_params() that can decode(unquote) header values in compliance with RFC2231 and RFC2047. But if in email message exists multiple headers with the same key it can't be used to decode other headers than first.
In my application I could use: 
   headers = message.items() 
   for key, value in headers:
       cleanValue = message.get_params(value=value)
       print(key, cleanValue)
Also have posted question on stackoverflow:
http://stackoverflow.com/questions/42502312/python-3-email-package-how-decode-given-header-value

----------
components: email
messages: 288720
nosy: barry, pi314159, r.david.murray
priority: normal
severity: normal
status: open
title: email.Message.get_params decodes only first one header value
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29678>
_______________________________________


More information about the New-bugs-announce mailing list