我试图使用以下简单代码通过FTP打开连接。但密码就挂在这条线上。它没有前进,它没有抛出任何异常或错误。我的代码已经有6个月的历史了,我一直能够使用这段代码连接到我的网站并下载文件。今天,当我去打开FTP连接时,它才刚刚开始挂起。
你知道会出什么问题吗?
ftp = ftplib.FTP("www.mySite.com") # hangs on this line
print("Im alive") # Never get printed out
ftp.login(username, password)
我和其他几个人一起管理这个网站,但是我们没有改变任何东西
我查阅了文档,发现了这些#之后,空闲连接将自动关闭。#设置为infinite以完全禁用空闲连接超时。空闲超时=10s
# Defines the default time period within which the application has to
# produce an HttpResponse for any given HttpRequest it received.
# The timeout begins to run when the *end* of the request has been
# received, so even potentially long up