[PATCH] Fix ftp error

John Arbash Meinel john at arbash-meinel.com
Thu Jan 5 00:01:53 GMT 2006


Wouter Bolsterlee wrote:
> P� Thu, Jan 05, 2006 at 09:58:34AM +1100, Robert Collins skrev:
> 
>>On Wed, 2006-01-04 at 20:49 +0100, Wouter Bolsterlee wrote:
>>
>>>-            raise NoSuchFile(self.abspath(relpath), extra=extra)
>>>+            s = str(e)
>>>+            raise NoSuchFile(self.abspath(relpath), extra=s) 
>>
>>Dunno about you but i find
>>               raise NoSuchFile(self.abspath(relpath), extra=str(e))
>>
>>easier to read than a temporary variable called 's' here.
>>
>>+0 as it is, +1 without 's'.
> 
> 
> The same variable is used a few lines below my change (but the resulting string
> is used twice there). But okay, here's the patch as you proposed:
> 
> === modified file 'bzrlib/transport/ftp.py'
> --- bzrlib/transport/ftp.py
> +++ bzrlib/transport/ftp.py
> @@ -177,7 +177,7 @@
>              ret.seek(0)
>              return ret
>          except ftplib.error_perm, e:
> -            raise NoSuchFile(self.abspath(relpath), extra=extra)
> +            raise NoSuchFile(self.abspath(relpath), extra=str(e))
> 
>      def put(self, relpath, fp):
>          """Copy the file-like or string object into the location.
> 
> Yes, I'm too lazy to attach a file.
> 
>   mvrgr, Wouter
> 

Two +1's, patched on my integration branch. You wouldn't happen to know
of a lightweight python implementation of an ftp server would you?

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060104/c0f7ede2/attachment.pgp 


More information about the bazaar mailing list