[issue36303] Trying to change values (fe. "To", "From") of email.mime.text.MIMEText after initial assigment silently doesn't change them.

Rémi Lapeyre report at bugs.python.org
Fri Mar 15 09:30:38 EDT 2019


Rémi Lapeyre <remi.lapeyre at henki.fr> added the comment:

I think this is the expected behavior, see https://docs.python.org/3.4/library/email.message.html#email.message.Message.__getitem__ for details:

> Note that if the named field appears more than once in the message’s headers, exactly which of those field values will be returned is undefined. Use the get_all() method to get the values of all the extant named headers.

This has been already discussed elsewhere, it may not be the best API but for compatibility reasons, we cannot change it anyway.

----------
nosy: +remi.lapeyre

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


More information about the Python-bugs-list mailing list