[ftputil] 421 Login Timeout (25 seconds)
Christopher Arndt
chris.arndt at web.de
Tue Jul 12 14:09:49 CEST 2005
geon at post.cz schrieb:
> Hi,
>
> I resend my question here adding some other info.:
>
> When I try to upload many files I get such a error message:
>
> Traceback (most recent call last):
> File "I:\Python\my_py\wwwzaci\xcopy_ftp.py", line 51, in ?
> except: x=host.upload(zdroj, cilFTP,'b')
Please look at the traceback carefully. The exception doesn't happen in
the code you showed at all! there is no x=host.upload(... line below.
If you post more code, please be sure to include at least the part where
you connect to the serevr. If the code is to long to include it in a
mail, put it on some webserver and post a link.
Cheers, Chris
> Part of my code:
> ....
>
> for root, dirs, files in os.walk(dirName):
>
> #print host._session.sendcmd('NOOP') # this didnt help
> pathRelFTP=ftpJoin(dirNameFTP+root.replace(dirName,''))
> print '\n',pathRelFTP
>
> if not host.path.exists(pathRelFTP):
> host.mkdir(pathRelFTP)
>
> for File in files:
>
> myfile=os.path.join(root,File)
> targetFTP=ftpJoin(pathRelFTP,File)
>
>
> if os.path.splitext(File)[1] in text:
> x= host.upload_if_newer(myfile, targetFTP)
> else:
> x= host.upload_if_newer(myfile, targetFTP,'b')
>
>
> I can send all the code, but its quite long. I am trying in it to
> send all the directory to ftpsite. ftpJoin is creating relative
> ftp path from full local path. Everything else might be clear.
More information about the ftputil
mailing list