Python ftplib WinError 10060

Viewed 4757

I am learning to retrieve files from an ftp server using ftplib from this link : https://docs.python.org/2/library/ftplib.html

When i run this code

from ftplib import FTP
ftp = FTP('ftp.debian.org')
ftp.login()

I get

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

From this answer https://stackoverflow.com/questions/4946960/when-using-ftplib-in-python#= i get to know that this is a server side issue which can be fixed by changing to ACTV mode.

So i changed my code to

from ftplib import FTP
ftp = FTP()
ftp.set_pasv(True)
ftp.connect('ftp.debian.org')
ftp.login()

Still same error. Can anyone tell me what other reasons could there be from my problem?

Edit - Using Python 3.6.1 on Thonny(IDE) in a 64 bit Win 10 environment

1 Answers
Related