Rev 5259: Merge http-leaks into sftp-leaks in file:///home/vila/src/bzr/experimental/leaking-tests/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Jun 10 18:09:17 BST 2010


At file:///home/vila/src/bzr/experimental/leaking-tests/

------------------------------------------------------------
revno: 5259 [merge]
revision-id: v.ladeuil+lp at free.fr-20100610170917-bvip5inihpcqybb5
parent: v.ladeuil+lp at free.fr-20100607194423-awlbzlylozq95pwk
parent: v.ladeuil+lp at free.fr-20100610170915-yb1vlmqgrbp3nmgm
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: sftp-leaks
timestamp: Thu 2010-06-10 19:09:17 +0200
message:
  Merge http-leaks into sftp-leaks
modified:
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2010-06-05 17:06:04 +0000
+++ b/bzrlib/osutils.py	2010-06-10 17:01:42 +0000
@@ -2038,7 +2038,8 @@
     # We don't use nor handle the timeout though
     def connect_socket(address, timeout=None):
         err = socket.error('getaddrinfo returns an empty list')
-        for res in socket.getaddrinfo(*address):
+        host, port = address
+        for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
             af, socktype, proto, canonname, sa = res
             sock = None
             try:
@@ -2046,11 +2047,11 @@
                 sock.connect(sa)
                 return sock
 
-            except socket.error, err:
+            except exc_class, err:
                 # 'err' is now the most recent error
                 if sock is not None:
                     sock.close()
-        raise err
+        raise exc_class, err
 
 
 def dereference_path(path):



More information about the bazaar-commits mailing list