我的python脚本中的ftp下载错误

我的python脚本中的ftp下载错误,python,ftp,md5sum,Python,Ftp,Md5sum,当我运行这个程序时,\n我在ftp.retrbinary('RETR'+fname,localfile.write,1024)的第行遇到以下错误 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 文件“C:\Python27\lib\ftplib.py”,第401行,在retrbinary中 数据=conn.recv(块大小) socket.error:[Errno 10054]远程主机已强制关闭现有连接 我不知道出了什么问题。请帮我整理一下你找到答案了吗?通过Python将2GB文件从F

当我运行这个程序时,\n我在ftp.retrbinary('RETR'+fname,localfile.write,1024)的第行遇到以下错误

回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“C:\Python27\lib\ftplib.py”,第401行,在retrbinary中
数据=conn.recv(块大小)
socket.error:[Errno 10054]远程主机已强制关闭现有连接

我不知道出了什么问题。请帮我整理一下

你找到答案了吗?通过Python将2GB文件从FTP拉到Azure VM时也存在类似问题
#print "Enter the server name \n"
server = "x.x.x.x"
#ftp = ftplib.FTP(server)
#print "Enter the USN /PWD"
path = raw_input ("Enter the path \n")    
ftp = ftplib.FTP(server,'xxx','yyy')
ftp.cwd(path)
fname = raw_input("Enter the Fname \n")
with open(fname) as file_to_check:
    #read content of the file
    csv1 = file_to_check.read()
    #pipe the contents of the file through
    md5_original = hashlib.md5(csv1).hexdigest()
localfile = open(fname, 'wb')
ftp.retrbinary('RETR ' + fname, localfile.write, 512)
print "Done ...."  
ftp.quit()
curpath = os.getcwd()
os.chdir(curdir)
with open(localfile) as file_to_check:
    #read content of the file
    csv2 = file_to_check.read()
    #pipe the contents of the file through
    md5_download = hashlib.md5(csv2).hexdigest()
# Finally compare original MD5 with freshly calculated
if orginal_md5 == md5_returned:
    print "MD5 verified."
else:
    print "MD5 verification failed!."    
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\ftplib.py", line 401, in retrbinary
data = conn.recv(blocksize)
socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host