]> granicus.if.org Git - python/commitdiff
Merged revisions 84284 via svnmerge from
authorGiampaolo Rodolà <g.rodola@gmail.com>
Mon, 23 Aug 2010 21:56:11 +0000 (21:56 +0000)
committerGiampaolo Rodolà <g.rodola@gmail.com>
Mon, 23 Aug 2010 21:56:11 +0000 (21:56 +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 7b922a98cc06a70fc3bf3822016ec5a2f4a8f7ad..7f06e43e7161e7cd6b09a43651d6fae9fcdfae13 100644 (file)
@@ -51,7 +51,7 @@ import socket
 import sys
 import time
 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:
@@ -333,8 +333,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 d88a483756442d541b696c54e5934fc6f1bdf5d6..b94623dc7dbf68d4160349d73ea4447688768aaf 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -95,6 +95,9 @@ C-API
 Library
 -------
 
+- Issue #658749: asyncore's connect() method now correctly interprets winsock
+  errors.
+
 - Issue #9214: Set operations on KeysView or ItemsView in the collections
   module now correctly return a set.  (Patch by Eli Bendersky.)