From: Giampaolo RodolĂ  Date: Mon, 23 Aug 2010 21:53:41 +0000 (+0000) Subject: fix issue 658749: correctly interprets asyncore's windows errors on connect() X-Git-Tag: v3.2a2~155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76fc8c7098e61a1dd1642b9465cd21ac6310d024;p=thirdparty%2FPython%2Fcpython.git fix issue 658749: correctly interprets asyncore's windows errors on connect() --- diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 874f101681aa..edb1c7bf5013 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 75375abe399b..dbfdae59180d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -123,6 +123,9 @@ Extensions Library ------- +- Issue #658749: asyncore's connect() method now correctly interprets winsock + errors; + - Issue #9501: Fixed logging regressions in cleanup code. - Fix functools.total_ordering() to actually work.