~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: John Arbash Meinel
  • Date: 2006-04-25 15:05:42 UTC
  • mfrom: (1185.85.85 bzr-encoding)
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: john@arbash-meinel.com-20060425150542-c7b518dca9928691
[merge] the old bzr-encoding changes, reparenting them on bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    Server,
47
47
    Transport,
48
48
    urlescape,
 
49
    urlunescape,
49
50
    )
50
51
import bzrlib.ui
51
52
 
338
339
        """
339
340
        # FIXME: share the common code across transports
340
341
        assert isinstance(relpath, basestring)
341
 
        relpath = urllib.unquote(relpath).split('/')
 
342
        relpath = urlunescape(relpath).split('/')
342
343
        basepath = self._path.split('/')
343
344
        if len(basepath) > 0 and basepath[-1] == '':
344
345
            basepath = basepath[:-1]
647
648
 
648
649
    def _split_url(self, url):
649
650
        if isinstance(url, unicode):
650
 
            url = url.encode('utf-8')
 
651
            # TODO: Disallow unicode urls
 
652
            #raise InvalidURL(url, 'urls must not be unicode.')
 
653
            url = url.encode('ascii')
651
654
        (scheme, netloc, path, params,
652
655
         query, fragment) = urlparse.urlparse(url, allow_fragments=False)
653
656
        assert scheme == 'sftp'
670
673
                raise TransportError('%s: invalid port number' % port)
671
674
        host = urllib.unquote(host)
672
675
 
673
 
        path = urllib.unquote(path)
 
676
        path = urlunescape(path)
674
677
 
675
678
        # the initial slash should be removed from the path, and treated
676
679
        # as a homedir relative path (the path begins with a double slash