[issue22965] smtplib.py: senderrs[each] -> TypeError: unhashable instance

R. David Murray report at bugs.python.org
Sun Nov 30 21:56:39 CET 2014


R. David Murray added the comment:

I'm not familiar with app-engine, so I don't understand the code snippet in the stackoverflow issue.  But what is happening here is that whatever it is you've supplied as the 'to' address is not a string, but sendmail expects it to be.

Now, since rcpt converts its argument to a string, you might think it would be reasonable for senderrs to do the same.  But that would not be correct, since then you would not be able to use whatever you passed in to to_addrs as the key to retrieve values from senderrs.  Even if for some reason one did not consider this important, it still couldn't be changed for backward compatibility reasons.  Basically, the fact that rcpt does the equivalent of str(addr) is an implementation detail.

I'm closing this as not a bug; that is, the values in to_addrs are required to be strings, which is how that attribute is documented.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list