我正在使用 ftplib 模块上传文件:
files = [ a.txt , b.txt , c.txt ]
s = ftplib.FTP(ftp_server , ftp_user , ftp_pw) # Connect to FTP
for i in range(len(files)):
f = open(files[i], 'rb')
stor = 'stor ' + files[i]
s.storbinary(stor, f)
f.close() # close file
s.quit() # close ftp
如何捕获以下错误?
socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
使用我还应该捕获的 FTP 模块时,还有哪些常见错误?
感谢您的任何帮助或指点。