svn path=/main/branches/2.1.2/; revision=7026
elif protocol in ["ftp"]:
data,rc,msg = make_ftp_request(conn, address, dest=dest)
elif protocol == "sftp":
- conn.get(address, dest)
+ rc = 0
+ try:
+ f = conn.open(address)
+ except SystemExit:
+ raise
+ except Exception:
+ rc = 1
+ else:
+ try:
+ if dest:
+ bufsize = 8192
+ while True:
+ data = f.read(bufsize)
+ if not data:
+ break
+ dest.write(data)
+ finally:
+ f.close()
else:
raise TypeError, "Unknown protocol. '%s'" % protocol