active ftp (aftp://) not properly supported

Bug #56472 reported by John A Meinel
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

It seems that internally active ftp degrades to passive ftp.
Probably the first Transport object is properly active, but after 'clone()' it switches to passive FTP. Because it has stripped off the 'a' portion of 'aftp://' in the url.

A possible fix is to change FTPTransport.abspath to use:
proto = 'ftp'
if self.is_active:
  proto = 'aftp'
return urlparse.urlunparse((proto, netloc, path, '', '', ''))

I will also attach a proposed fix by ghozzy_

Revision history for this message
John A Meinel (jameinel) wrote :

Fix proposed by ghozzy_.
Also needed would be a test case. It could either test that:

t = get_transport('aftp://host/path')
self.failUnless(t.is_active)
parent = t.clone('..')
self.failUnless(parent.is_active)

We also should probably assert that:

self.assertEqual('aftp://host/path/', t.abspath(''))
To make sure abspath is returing the right string.

Revision history for this message
ghozzy (ghozzy) wrote :

here is the patch against today's bzr.dev
it includes fix, test case and update to NEWS.

i've taken a look at FtpTransport.abspath() method, but it calls self._unparse_url(path), which in turn calls urlparse.urlunparse(('ftp', netloc, path, '', '', '')) so the fix is applied to the latter.

Revision history for this message
John A Meinel (jameinel) wrote :

The associated patch was merged and commited. With a small change to change to test_ftp_transport.py because it is more obvious when looking for tests.

Changed in bzr:
importance: Untriaged → Medium
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.