This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author phil_schwartz
Date 2005-06-15.23:15:18
SpamBayes Score
Marked as misclassified
The ftplib.FTP class currently allows the ability to
provide a callback function for the retrbinary &
retrlines methods to invoke.  However, the
corresponding storbinary and storlines methods do not.

My ReleaseForge application currently uses the ftplib
to send files (rather than retrieve) and it's helpful
to know the percentage of the file that has been sent.
 For my app I subclassed ftplib.FTP and reimplemented
storbinary to optionally accept a callback function as
a parameter.  

However, I think this would be a useful method to
include in the standard python distribution.  I've
attached a modified version of which adds
this functionality.  Unlike the retrX methods, the
storX methods only invoke the callback function if it's
not None so that it will not interfere with existing
code.  For completeness, the retrX methods invoke
print_line if a callback function is not provided and
doing so for the storX functions may be undesired.
Date User Action Args
2007-08-23 15:43:18adminlinkissue1221598 messages
2007-08-23 15:43:18admincreate