summaryrefslogtreecommitdiffstats
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2007-06-06 15:13:37 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2007-06-06 15:13:37 (GMT)
commit92493120209565d6db37fe97c5bdb2f14d6a9c25 (patch)
tree2d6fc4c161435597e7937de186d953d5b85b777c /Lib/ftplib.py
parent50b79ce8e6629eb995a0b2091efebe9a5d458273 (diff)
downloadcpython-92493120209565d6db37fe97c5bdb2f14d6a9c25.zip
cpython-92493120209565d6db37fe97c5bdb2f14d6a9c25.tar.gz
cpython-92493120209565d6db37fe97c5bdb2f14d6a9c25.tar.bz2
FTP.ntransfercmd method now uses create_connection when passive,
using the timeout received in connection time.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index f9b6396..3e9189e 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -319,9 +319,7 @@ class FTP:
size = None
if self.passiveserver:
host, port = self.makepasv()
- af, socktype, proto, canon, sa = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[0]
- conn = socket.socket(af, socktype, proto)
- conn.connect(sa)
+ conn = socket.create_connection((host, port), self.timeout)
if rest is not None:
self.sendcmd("REST %s" % rest)
resp = self.sendcmd(cmd)