]> granicus.if.org Git - python/commitdiff
Fredrik Lundh:
authorGuido van Rossum <guido@python.org>
Tue, 28 Mar 2000 21:45:46 +0000 (21:45 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 28 Mar 2000 21:45:46 +0000 (21:45 +0000)
This fixes a bunch of socket.connect(host, post) calls.  Note that I
haven't tested all modules -- I don't have enough servers here...

Lib/ftplib.py
Lib/gopherlib.py
Lib/httplib.py
Lib/imaplib.py
Lib/nntplib.py
Lib/poplib.py
Lib/smtplib.py

index 9e3b701d2c9cf0bbc5816f5e3c0c22fe58355ee4..fd9127bff152c7d335a47e90a4572403151b7536 100644 (file)
@@ -115,7 +115,7 @@ class FTP:
                if port: self.port = port
                self.passiveserver = 0
                self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-               self.sock.connect(self.host, self.port)
+               self.sock.connect((self.host, self.port))
                self.file = self.sock.makefile('rb')
                self.welcome = self.getresp()
                return self.welcome
@@ -265,7 +265,7 @@ class FTP:
                if self.passiveserver:
                        host, port = parse227(self.sendcmd('PASV'))
                        conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-                       conn.connect(host, port)
+                       conn.connect((host, port))
                        resp = self.sendcmd(cmd)
                        if resp[0] <> '1':
                                raise error_reply, resp
index d805f151d090855e0df88fddc1c46d70a723d336..6965fbdb8a94d16088312a0bdc20f04cf05ac873 100644 (file)
@@ -66,7 +66,7 @@ def send_selector(selector, host, port = 0):
     elif type(port) == type(''):
         port = string.atoi(port)
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    s.connect(host, port)
+    s.connect((host, port))
     s.send(selector + CRLF)
     s.shutdown(1)
     return s.makefile('rb')
index a43addeb4983503ff59966ce5e51fefda2cce5ef..8c8084e98ea009947b04a46f282912f642572265 100644 (file)
@@ -109,7 +109,7 @@ class HTTP:
         if not port: port = HTTP_PORT
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         if self.debuglevel > 0: print 'connect:', (host, port)
-        self.sock.connect(host, port)
+        self.sock.connect((host, port))
 
     def send(self, str):
         """Send `str' to the server."""
@@ -209,7 +209,7 @@ if hasattr(socket, "ssl"):
             if not port: port = HTTPS_PORT
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             if self.debuglevel > 0: print 'connect:', (host, port)
-            sock.connect(host, port)
+            sock.connect((host, port))
             ssl = socket.ssl(sock, self.key_file, self.cert_file)
             self.sock = FakeSocket(sock, ssl)
 
index 31893a561bddd44f32c3447e8a85a26dea15a8f6..921ee0cbecddf00248aa0bfc9fc2c555542f09f4 100644 (file)
@@ -191,7 +191,7 @@ class IMAP4:
        def open(self, host, port):
                """Setup 'self.sock' and 'self.file'."""
                self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-               self.sock.connect(self.host, self.port)
+               self.sock.connect((self.host, self.port))
                self.file = self.sock.makefile('r')
 
 
index 292e6b04c58b42ac506891c7be3fef0f77ee322f..81449b03d10a7fb7348df507b24dc0ba142197cd 100644 (file)
@@ -108,7 +108,7 @@ class NNTP:
                self.host = host
                self.port = port
                self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-               self.sock.connect(self.host, self.port)
+               self.sock.connect((self.host, self.port))
                self.file = self.sock.makefile('rb')
                self.debugging = 0
                self.welcome = self.getresp()
index a4fd2bc32c88bdc782e21785cad45480cff84b5b..118811caafd1825f54e9b8b362ace7f76ce9e0a0 100644 (file)
@@ -77,7 +77,7 @@ class POP3:
                self.host = host
                self.port = port
                self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-               self.sock.connect(self.host, self.port)
+               self.sock.connect((self.host, self.port))
                self.file = self.sock.makefile('rb')
                self._debugging = 0
                self.welcome = self._getresp()
index f58d5fc10d74777ce6e0b34231e31d6f52c0095b..4462d620d387189a0439305c1dd943909c6ccb2c 100755 (executable)
@@ -213,7 +213,7 @@ class SMTP:
         if not port: port = SMTP_PORT
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         if self.debuglevel > 0: print 'connect:', (host, port)
-        self.sock.connect(host, port)
+        self.sock.connect((host, port))
         (code,msg)=self.getreply()
         if self.debuglevel >0 : print "connect:", msg
         return (code,msg)