Derek Morr <[email protected]> added the comment:
Yes. The patch is against 2.6. It uses the socket.create_connection()
helper function, which was added in 2.6. See http://svn.python.org/view?
rev=54546&view=rev for the commit message.
If you really want to apply it to 2.5, it's trivial to adapt the patch.
Just replace the call to create_connection() with something like this:
msg = "getaddrinfo returns an empty list"
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
sock.connect(sa)
self.sock = sock
except error, msg:
if sock is not None:
sock.close()
raise error, msg
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue1664>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com