The following code works flawlessly in Linux, retrieving the list of folders/files available in the FTP server:
from ftplib import FTP
server = FTP('ftp.ibge.gov.br')
server.connect()
server.login()
server.nlst()
However, in Windows 10, I get the server welcome message after connect() and the '230 login successful" message, but when I try to send any command to the server - like server.nlst()
or server.dir()
- socket.py
raises a TimeoutError [WinError 10060]
I am 100% sure that the server is up, and in Linux server.nlst()
retrieves the information fast as lightning - so, it is not a "true" timeout error, if I set timeout=1000
, or larger, I get the same error.
What is wrong?