[MERGE] "bzr commit" fails with Microsoft FTP Service

Aaron Bentley aaron at aaronbentley.com
Fri Apr 11 15:48:34 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> Andreas Deininger wrote:
> 550 doesn't have a well defined meaning in the context of a rename.  It
> could mean "file does not exist" or "new name could not be created"
> (because ftplib's rename does RNFR and RNTO, and either can fail with
> 550, and you can't tell which it was from the exception).

In the long term, we may want to provide our own FTP rename
implementation so that we can tell which verb failed.  The ftplib
implementation is quite simple, so doing our own isn't out of the question:

    def rename(self, fromname, toname):
        '''Rename a file.'''
        resp = self.sendcmd('RNFR ' + fromname)
        if resp[0] != '3':
            raise error_reply, resp
        return self.voidcmd('RNTO ' + toname)

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/3pC0F+nu1YWqI0RAoBhAKCEkAlRNr0OUvxYqi1QFC9hpRwT4QCff2qy
94J3CRP500agZnEXsoRifT4=
=zEGx
-----END PGP SIGNATURE-----



More information about the bazaar mailing list