[issue6589] smtpd.SMTPServer can cause asyncore.loop to enter infinite event loop

Casey McGinty report at bugs.python.org
Mon Jun 28 23:00:58 CEST 2010


Casey McGinty <casey.mcginty at gmail.com> added the comment:

This is how it gets in an "invalid state". Not sure why you can't look at the code and see the mistake.

"There is no code in the
SMTPServere.__init__ method that catches the exception raised, caused by
the failed bind attempt. After the exception is caught, the first thread
continues to run, but asyncore is in an invalid state because it still
has the registration of the second SMTPServer instance that never completed."

As far as running in a thread. I have a program that needs must start and stop the SMTPServer dynamically. I did this by putting SMTPServer in a thread. Maybe there is another way to do it, but if you are not going to support this, then it should be documented.

----------

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


More information about the Python-bugs-list mailing list