Index: Doc/library/ftplib.rst =================================================================== --- Doc/library/ftplib.rst (revision 74738) +++ Doc/library/ftplib.rst (working copy) @@ -198,14 +198,15 @@ it is on by default.) -.. method:: FTP.storbinary(command, file[, blocksize, callback]) +.. method:: FTP.storbinary(command, file[, blocksize, callback, rest]) Store a file in binary transfer mode. *command* should be an appropriate ``STOR`` command: ``"STOR filename"``. *file* is an open file object which is read until EOF using its :meth:`read` method in blocks of size *blocksize* to provide the data to be stored. The *blocksize* argument defaults to 8192. *callback* is an optional single parameter callable that is called - on each block of data after it is sent. + on each block of data after it is sent. *rest* means the same thing as in + the :meth:`transfercmd` method. .. versionchanged:: 2.1 default for *blocksize* added. @@ -213,6 +214,8 @@ .. versionchanged:: 2.6 *callback* parameter added. + .. versionchanged:: 2.7 + *rest* parameter added. .. method:: FTP.storlines(command, file[, callback]) Index: Lib/ftplib.py =================================================================== --- Lib/ftplib.py (revision 74738) +++ Lib/ftplib.py (working copy) @@ -430,7 +430,7 @@ conn.close() return self.voidresp() - def storbinary(self, cmd, fp, blocksize=8192, callback=None): + def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None): """Store a file in binary mode. A new port is created for you. Args: @@ -440,12 +440,13 @@ the connection at once. [default: 8192] callback: An optional single parameter callable that is called on on each block of data after it is sent. [default: None] + rest: Passed to transfercmd(). [default: None] Returns: The response code. """ self.voidcmd('TYPE I') - conn = self.transfercmd(cmd) + conn = self.transfercmd(cmd, rest) while 1: buf = fp.read(blocksize) if not buf: break