[Bug 28850] FTP transport: put: fails during push operation

Daniel Silverstone dsilvers at digital-scurf.org
Wed Jan 18 14:32:21 GMT 2006


On Wed, 2006-01-18 at 08:21 -0600, John A Meinel wrote:
> Is there an explicit request for this? Daniel has quite a few changes in
> his branch (the improvements to 'bzr missing', the ftp fixes, etc). I
> can just take the FTP fixes to start with...

IIRC all but the FTP stuff, a NEWS entry for bzr missing and a bizarre
patch to changeset.py has been merged into martin's mainline anyway.

Speaking with martin last week he said he'd merge it and undo the
changeset.py change. However if you think the exceptions are wrong then
I should fix those first.

> The cache seems about right. I'm a little concerned that the first
> connection would be active, and subsequent connections would be passive,
> but that is pretty unlikely to happen.

Umm, I don't quite see why this situation would ever arise since passive
vs. active is always chosen by the url scheme.

> > +
> > +class FtpTransportError(TransportError):
> > +    pass
> I think we've gotten away from inheriting new errors in the transports.
> I know we used to, but I checked, and none of the other transports do
> anymore. (We really don't prefer to create exceptions inside main
> classes anyway)

Okay, so I should drop this in favour of raising pure TransportErrors ?
Or should I be declaring FtpTransportError somewhere else?


> NoSuchFile doesn't take a msg anymore, it takes a path, and an 'extra'
> value. So you want to raise:
>     raise NoSuchFile(self.abspath(relpath), extra=e)
>   else:
>     raise TransportError(orig_error=e)

Okay, I can clean this up.

> >      def mkdir(self, relpath, mode=None):
> >          """Create a directory at the given path."""
> > 
> I also noticed that you don't handle any of the mode=? stuff. Does FTP
> support chmod?

FTP itself supports it, but not ftplib (as you noted in some patches to
the ftp library you did)

> So with a little bit of cleanup, this seems to solve the ftp push issue.

Aye, It solved the problem back when I wrote it, but I'll admit I don't
use the FTP protocol very much (if ever) myself.

The way I see it, my branch needs a little tweaking to clean it up and
then it should be okay for merging -- I shall do this asap.

D.

-- 
Daniel Silverstone                         http://www.digital-scurf.org/
PGP mail accepted and encouraged.            Key Id: 2BC8 4016 2068 7895






More information about the bazaar mailing list