[Patches] [Patch #101187] Patch for ftplib to support REST

noreply@sourceforge.net noreply@sourceforge.net
Thu, 31 Aug 2000 23:04:16 -0700


Patch #101187 has been updated. 

Project: 
Category: Modules
Status: Accepted
Summary: Patch for ftplib to support REST

Follow-Ups:

Date: 2000-Aug-15 15:34
By: tim_one

Comment:
Assigned to Barry for an opinion.  This came in after feature freeze, but it's arguably more of a bugfix than a new feature.  If you're capable of making that decision with more confidence than me, please Postpone it or assign it to a competent (not me) reviewer for 2.0.
-------------------------------------------------------

Date: 2000-Aug-22 00:09
By: moshez

Comment:
This seems great, and I'm very +1, except for one thing: the ``self.sendcmd("REST %.0f" % rest)'' thing: wouldn't it be better to self.sendcmd("REST %d" % int(rest))? 
Other then that, it seems to do nothing when the rest argument is not given, so it can't hurt too much. Oh, and of course, this needs doc patches.

 
-------------------------------------------------------

Date: 2000-Aug-22 08:33
By: none

Comment:
I realized some problem yesterday ... ftp-daemons which do not support REST throw a 502 exception
-------------------------------------------------------

Date: 2000-Aug-22 09:05
By: preisl

Comment:
Ok, forget my last commet (yep, it was me, who forgot to login) ... I think it's ok that the ftplib throws the exception, since the user knows, that he mustn't use the rest parameter then.
-------------------------------------------------------

Date: 2000-Aug-24 07:59
By: moshez

Comment:
OK, here's a stab at what's needed for documentation changes:

Add to the prototype of the "ntransfercmd()" and "transfercmd" an \optional{, rest} and to the description a paragraph:

If the \var{rest} parameter is given, it should be an integer, specifying how many initial bytes of the file the tranfer command should ignore. If the FTP server does not support the \code{REST} command, and the \var{rest} argument is used, an exception will be raised. Programs might want to deal with it by initiating a transfer without \var{rest}, and ignore the first \var{rest} bytes. (Of course, this option is much more costly in terms of time and network resources used.)
-------------------------------------------------------

Date: 2000-Aug-26 08:55
By: preisl

Comment:
Agreed to the doc ... but please stick to te %.0f, restricting to %d would limit the filesize to about 2gb which might be enough now, but probably not for the future.
-------------------------------------------------------

Date: 2000-Aug-31 23:04
By: bwarsaw

Comment:
RFC 959 says that the argument to REST is a "marker", essentially a string containing any ASCII characters in the range [33..126].  So the argument should be interpolated into the string with %s, not %d or %f

I don't believe it's worth sanity checking the the argument to make sure all characters fall within this range, but it should be included in the documentation.

I will accept this patch, and make this change when I check it in.

I'll also make the patch conform to Python coding standards - compare to None using "is" and "is not" instead of == an !=

- no parens around comparison
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101187&group_id=5470