Set timeout for FTP transfer.

This commit is contained in:
valfieri
2020-10-16 21:31:28 +02:00
parent d5a8b80f5a
commit cab90b8fe2

View File

@@ -12,7 +12,7 @@ def main():
(options, args) = parser.parse_args()
if (options.url and options.local and options.remote and options.user and options.password):
ftp = FTP(options.url)
ftp = FTP(options.url, timeout=100)
ftp.login(options.user, options.password)
with open(options.local, 'r') as f:
ftp.storbinary('STOR %s' % options.remote, f)