STINNER Victor added the comment: "Workaround: (...) e = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)"
Oh, it looks like the issue was already fixed 4 years ago: --- changeset: 63720:ba7353147507 branch: 3.1 parent: 63716:915b028b954d user: Giampaolo RodolĂ <g.rod...@gmail.com> date: Wed Aug 04 09:04:53 2010 +0000 files: Lib/asyncore.py Misc/ACKS Misc/NEWS description: Merged revisions 83705 via svnmerge from svn+ssh://python...@svn.python.org/python/branches/py3k ........ r83705 | giampaolo.rodola | 2010-08-04 11:02:27 +0200 (mer, 04 ago 2010) | 1 line fix issue #2944: asyncore doesn't handle connection refused correctly (patch by Alexander Shigin). Merged from 2.7 branch. ........ diff -r 915b028b954d -r ba7353147507 Lib/asyncore.py --- a/Lib/asyncore.py Wed Aug 04 04:53:07 2010 +0000 +++ b/Lib/asyncore.py Wed Aug 04 09:04:53 2010 +0000 @@ -426,8 +426,11 @@ class dispatcher: self.handle_read() def handle_connect_event(self): + err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) + if err != 0: + raise socket.error(err, _strerror(err)) + self.handle_connect() self.connected = True - self.handle_connect() def handle_write_event(self): if self.accepting: ... --- ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue777588> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com