Aahz <[EMAIL PROTECTED]> wrote: > One small wrinkle (and the reason I suggested bringing this to > python-dev): I suspect that the problem is not a bug, but simply the > occasional failure of sockets. When that happens in a threaded app > without timeouts, eventually threads "die" (block forever). But you > apparently can't use timeouts with file-wrapped sockets, so if that's the > problem, we need to pick one of: > > * switch to non-wrapped sockets > * switch to non-blocking I/O for smtplib > * make file-wrapped sockets work with timeouts
In case it's helpful, I've put the file-like-sockets-with-timeouts code that I wrote up here: http://www.unequivocal.co.uk/dl/socketutils.py This is a pure-Python implementation that provides a file-like interface to a socket, with timeouts, that definitely works with threaded programs. Note it was written in 2002, so any part of the Python 'file' interface which was added since then is not in there. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com