From: Giampaolo RodolĂ  Date: Mon, 23 Aug 2010 21:58:47 +0000 (+0000) Subject: Merged revisions 84284 via svnmerge from X-Git-Tag: v2.7.1rc1~370 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63308d7c083e42064e185f3866d8ba15d1faa69a;p=python Merged revisions 84284 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84284 | giampaolo.rodola | 2010-08-23 23:53:41 +0200 (lun, 23 ago 2010) | 1 line fix issue 658749: correctly interprets asyncore's windows errors on connect() ........ --- diff --git a/Lib/asyncore.py b/Lib/asyncore.py index c3b9d76954..083920c389 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -53,7 +53,7 @@ import time import warnings import os -from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ +from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \ ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode try: @@ -337,8 +337,8 @@ class dispatcher: def connect(self, address): self.connected = False err = self.socket.connect_ex(address) - # XXX Should interpret Winsock return values - if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): + if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \ + or err == EINVAL and os.name in ('nt', 'ce'): return if err in (0, EISCONN): self.addr = address diff --git a/Misc/NEWS b/Misc/NEWS index ed9c192481..fe9be71603 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -31,6 +31,9 @@ Core and Builtins Library ------- +- Issue #658749: asyncore's connect() method now correctly interprets winsock + errors. + - Issue #9501: Fixed logging regressions in cleanup code. - Issue #9214: Set operations on KeysView or ItemsView in the collections