ftplib - Did the whole file get sent?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Oct 23 07:48:10 CEST 2010

On Fri, 22 Oct 2010 22:03:38 -0700, Sean DiZazzo wrote:

> How can I assure him (and the client) that the transfer completed
> successfully like my log shows?

"It has worked well for many years, there are no reported bugs in the ftp 
code, and the logs show the file was transferred correctly. Unless you 
can reproduce the failure, there's no evidence that my code is to blame 
for the failure. How do you know that the original file wasn't corrupted 
before the transfer? Or that the copy wasn't corrupted after the 
transfer? Does it copy correctly if you try again? Can you give me a copy 
of the file for testing?"

> Is ftplib reliable enough to say that if an exception is not thrown,
> that the file was transferred in full?

Python 2.4 is pretty old. Have you checked the bug tracker to see if 
there are any reported bugs in ftplib that might be relevant? Or the 
What's New for 2.5, 2.6 and 2.7? The source code for ftplib seems fairly 
straightforward to me -- if there was an error, I can't see that it could 
have been suppressed.

But really, unless you can reproduce the error, I'd say the error lies 


More information about the Python-list mailing list