]> granicus.if.org Git - python/commitdiff
Merged revisions 84284 via svnmerge from
authorGiampaolo Rodolà <g.rodola@gmail.com>
Mon, 23 Aug 2010 21:58:47 +0000 (21:58 +0000)
committerGiampaolo Rodolà <g.rodola@gmail.com>
Mon, 23 Aug 2010 21:58:47 +0000 (21:58 +0000)
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()
........

Lib/asyncore.py
Misc/NEWS

index c3b9d769549f024d518b146ef49ee24632c66c37..083920c38933192b6e4a1de0134d9ab1e241d85a 100644 (file)
@@ -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
index ed9c1924811a3fc2c47ad3aa05789e3bb1a42d8c..fe9be716035420fddec4d86549a2e171d2d2bc33 100644 (file)
--- 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