I am trying to use ftplib.FTP()
with timeout option as some timeout value for a particular hostname. But i am experiencing weird behaviour. To test it i have written a very simple piece of code.
import ftplib
from ftplib import FTP
ftp = ftplib.FTP("google.com",timeout=2)
The API document says to enter timeout value in seconds, but it seems that it takes longer than that, for me it almost takes more than 8 secs. Can anybody please explain the behaviour.I am using python2.7