Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue1221598

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:ftplib storbinary/storlines callback function
Type:Stage:
Components:Library (Lib)Versions:Python 2.5
process
Status:closedResolution:accepted
Dependencies:Superseder:
Assigned To: gregory.p.smithNosy List: georg.brandl, giampaolo.rodola, gregory.p.smith, nnorwitz, phil_schwartz, tcarroll
Priority:normalKeywords:patch

Created on2005-06-15 23:15 byphil_schwartz, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
ftplib.pyphil_schwartz,2005-06-15 23:15ftplib.FTP storbinary and storlines accept a callback func parameter
ftplib.py.patchphil_schwartz,2006-07-03 18:09ftplib.py patched (based on python 2.4.3-8 FC5 x86_64 rpm)
unnamedgregory.p.smith,2008-01-22 20:42
Messages (9)
msg48472 -(view)Author: Phil Schwartz (phil_schwartz)Date: 2005-06-15 23:15
The ftplib.FTP class currently allows the ability toprovide a callback function for the retrbinary &retrlines methods to invoke.  However, thecorresponding storbinary and storlines methods do not.My ReleaseForge application currently uses the ftplibto send files (rather than retrieve) and it's helpfulto know the percentage of the file that has been sent. For my app I subclassed ftplib.FTP and reimplementedstorbinary to optionally accept a callback function asa parameter.  However, I think this would be a useful method toinclude in the standard python distribution.  I'veattached a modified version of ftplib.py which addsthis functionality.  Unlike the retrX methods, thestorX methods only invoke the callback function if it'snot None so that it will not interfere with existingcode.  For completeness, the retrX methods invokeprint_line if a callback function is not provided anddoing so for the storX functions may be undesired.
msg48473 -(view)Author: Georg Brandl (georg.brandl)*(Python committer)Date: 2006-03-28 07:52
Logged In: YES user_id=849994Please provide your patch as a diff between the originalftplib.py and your version. It greatly helps reviewers.
msg48474 -(view)Author: Phil Schwartz (phil_schwartz)Date: 2006-07-03 18:09
Logged In: YES user_id=420501Attached patch of ftplib.py (of Python 2.4.3)
msg48475 -(view)Author: Terry Carroll (tcarroll)Date: 2007-04-25 00:08
I'd like to voice some support for this patch, if that's not out of line.  I've used it myself in at least one app, and it would be nice to have it as a standard feature in 2.6.It seems odd that the callback feature is in the two retrieval methods, but not the store methods.  Ruby, for example, supports it in both.  Not that Python has to do everything Ruby does, but there doesn't seem to be any obstacle to adding this support.
msg48476 -(view)Author: Neal Norwitz (nnorwitz)*(Python committer)Date: 2007-04-25 05:39
Terry, your comment is definitely *not* out of line!  The more people comment on patches the easier it is for us to make a decision.  It would be great to comment on other patches or bugs that affect you.  Thanks.
msg61470 -(view)Author: Gregory P. Smith (gregory.p.smith)*(Python committer)Date: 2008-01-22 00:20
accepted, committed as svnr60188 for 2.6.  I also cleaned up the retr*and stor* doc strings.
msg61529 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2008-01-22 20:00
Could I propose the following docstring corrections?@@ -313,7 +313,7 @@         expected size may be None if it could not be determined.          Optional `rest' argument can be a string that is sent as the-        argument to a RESTART command.  This is essentially a server+        argument to a REST(art) command.  This is essentially a server         marker used to tell the server to skip over any data up to the         given marker.         """@@ -403,7 +403,7 @@         """Retrieve data in line mode.  A new port is created for you.          Args:-          cmd: A RETR or LIST command.+          cmd: A RETR, LIST, NLST or MLSD command.           callback: An optional single parameter callable that is called                     for each line with the trailing CRLF stripped.                     [default: print_line()]
msg61537 -(view)Author: Gregory P. Smith (gregory.p.smith)*(Python committer)Date: 2008-01-22 20:42
thanks.  applied (well, they will be when svn.python.org comes back)On 1/22/08, Giampaolo Rodola' <report@bugs.python.org> wrote:>>> Giampaolo Rodola' added the comment:>> Could I propose the following docstring corrections?>>
msg61542 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2008-01-22 22:28
Another one. On line 542:-        # Note that the RFC doesn't say anything about 'SIZE'+        # SIZE command is defined in RFC-3659
History
DateUserActionArgs
2022-04-11 14:56:11adminsetgithub: 42089
2008-01-22 22:28:34giampaolo.rodolasetmessages: +msg61542
2008-01-22 20:42:01gregory.p.smithsetfiles: +unnamed
messages: +msg61537
2008-01-22 20:00:23giampaolo.rodolasetnosy: +giampaolo.rodola
messages: +msg61529
2008-01-22 00:20:20gregory.p.smithsetstatus: open -> closed
resolution: accepted
messages: +msg61470
2008-01-21 23:48:54gregory.p.smithsetassignee:gregory.p.smith
nosy: +gregory.p.smith
2005-06-15 23:15:18phil_schwartzcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp