[PATCH] Fix ftp error

Wouter Bolsterlee uws at xs4all.nl
Wed Jan 4 23:14:50 GMT 2006


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

-- 
:wq                                                       mail uws at xs4all.nl
                                                      web http://uwstopia.nl

it's the one fatal flaw :: let us swallow you all, you all          -- gomez
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060105/c1457fc3/attachment.pgp 


More information about the bazaar mailing list