[d]大侠请留步!!!急急急 python:425 Can't open data connection本帖最后由 fibbery 于 2012-09-29 0
[d]大侠请留步!!!急急急 python:425 Can't open data connection
本帖最后由 fibbery 于 2012-09-29 09:59:02 编辑 自己实现了了个ftp客户端,进行上传下载文件操作。但是偶尔会出现425 Can't open data connection这个错误。
求解决办法。
#下载文件
try:
ftp.retrbinary("RETR %s"%filename, my_f, buf_size)
except:
print ("----------------ERROR")
#上传文件
try:
ftp.storbinary('STOR %s'%file_name, f_log, buf_size)
except:
print ('----------------ERROR')
File "E:\t\AutoTestClientCodes\ServerConf.py", line 145, in ftp_upload
ftp.storbinary('STOR %s'%file_name, f_log, buf_size)
File "C:\Python26\lib\ftplib.py", line 448, in storbinary
conn = self.transfercmd(cmd)
File "C:\Python26\lib\ftplib.py", line 356, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "C:\Python26\lib\ftplib.py", line 327, in ntransfercmd
resp = self.sendcmd(cmd)
File "C:\Python26\lib\ftplib.py", line 243, in sendcmd
return self.getresp()
File "C:\Python26\lib\ftplib.py", line 216, in getresp
raise error_temp, resp
error_temp: 425 Can't open data connection.
-------------------
Double行动:
原帖分数:40
帖子加分:40
[解决办法]ftp 数据通道模式采用哪种:主动、被动?设置一下试试
[解决办法]应该采用:主动方式么?