Martin v. Löwis <mar...@v.loewis.de> added the comment: IIUC, the bug only occurs if you use the same SMTP object for multiple connections. I would claim that this is a bug in the application: SMTP objects are not designed to be used for multiple connections. You need to create a new one for each connection.
If you want to extend the SMTP class to work for multiple connections, the provided patch is incorrect. Resetting the attributes should not be done in .connect() (i.e. for the new connection), but in .close() (i.e. when shutting down the previous connection). Furthermore, it should not only reset the two response attributes, but all per-connection attributes (which includes e.g. esmtp_features), and a test should be provided that, after close, only known "good" attributes remain set on the object (e.g. debuglevel). ---------- nosy: +loewis _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4142> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com