I am trying to connect to ftp.debian.org, using the very basic example shown in the official Python documentation (https://docs.python.org/2/library/ftplib.html) but I keep getting errors. Hope someone can point out where I'm going wrong.
import socket
from ftplib import FTP
try:
print("Attempting login...")
ftp = FTP('ftp.debian.org')
ftp.login()
# print("Listing directory...")
# ftp.retrlines('LIST')
# print("Ending the connection...")
# ftp.quit()
except socket.timeout:
print("Socket timeout caught")
finally:
print("FTP connection test has ended.")
The error I receive is the following:
Traceback (most recent call last):
TimeoutError: [WinError 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