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 <[email protected]>
<http://bugs.python.org/issue29678>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com