1

Hello I have a simple function below to list all files on a ftp server.

import ftputil
ftp = ftputil.FTPHost("3.xxx.xxx.xx","xxxxxxxx", "xxxxx")
for (Root, dirs, files) in ftp.walk(Root) : #Iterate over remote file
    for fileName in files :
        list[Root+ "/"] = fileName
ftp.close()

Sometimes the listing is done well but sometimes I get the errors : ftputil.ftp_error.FTPOSError : 10054 or ftputil.ftp_error.FTPOSError : 10060

Unfortunately, the server is behind a firewall that I cannot modify. But my questions are, do I use properly the ftputil library ? Do I get these error because I open to many connections ? Is it possible to fix these errors without changing firewall properties ?

komawak
  • 11
  • 2
  • What is operating system where you run your script? 10054 is code for connection reset while 10060 is timeout in windows sockets, which can be the clue to the network problems. – myaut Nov 19 '15 at 15:03
  • The scripts is launched on Windows 7 x86 (32bits) OS and OS on the ftp server is Windows 7 x64. But I get both errors.... – komawak Nov 19 '15 at 15:23
  • I suggest you to try to diagnose network problems with Wireshark. That is network sniffer which captures and decodes packets. Simply filter packets by your ftp server IP and ensure that it responds correctly. – myaut Nov 20 '15 at 10:04
  • Got nothing relevent from Wireshark. FTP server answers correctly till a moment that it does no longer send sync acknowledgement. Last response from server is "Entering Passive mode" – komawak Nov 24 '15 at 11:36
  • When FTP is in passive mode, server provides new port to which ftp client have to connect to receive file. Apparently, it couldn't do it. – myaut Nov 26 '15 at 19:16

0 Answers0