[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:34:53 EDT 2019


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

Here's how you can rewrite your code so it is more explicit:

Python 3.7.2 (default, Feb 12 2019, 08:15:36)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.mime.text import MIMEText
>>> msg = MIMEText('<div/>', 'html')
>>> msg.add_header('To', "this.email.shouldnt.be.printed at nokia.com")
>>> msg.add_header('To', "valid.email at nokia.com")
>>> print(msg.get_all('To'))
['this.email.shouldnt.be.printed at nokia.com', 'valid.email at nokia.com']

----------
versions: +Python 3.8

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


More information about the Python-bugs-list mailing list