[issue11959] smtpd cannot be used without affecting global state

Vinay Sajip report at bugs.python.org
Tue May 21 21:07:24 CEST 2013


Vinay Sajip added the comment:

I wasn't suggesting changing the signature of create_socket, I just thought that it needed to be reimplemented because it didn't pass a map to set_socket. I've had a look at it again, and a reimplementation of create_socket doesn't seem to be needed, after all, because:

SMTPServer.__init__ can pass the map it received to dispatcher.__init__, which will cause it to be set in self._map. Then, when create_socket calls set_socket with no map, that will call add_channel with map=None, which will then cause self._map to be used.

I'll update the patch as soon as I get a chance.

----------

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


More information about the Python-bugs-list mailing list