patch: fix sftp paths
Robey Pointer
robey at lag.net
Wed Nov 30 09:36:38 GMT 2005
This patch fixes absolute SFTP paths to work again after James' patch
(removes 3 lines of old code that are no longer needed now that we're
properly un-parsing urls), and also fixes a unicode encoding issue in
the exclusive-open code.
robey
=== modified file 'bzrlib/transport/sftp.py'
--- bzrlib/transport/sftp.py
+++ bzrlib/transport/sftp.py
@@ -570,9 +570,6 @@
vendor = _get_ssh_vendor()
if (self._path is None) or (self._path == ''):
self._path = ''
- else:
- # remove leading '/'
- self._path = urllib.unquote(self._path[1:])
if vendor != 'none':
sock = SFTPSubprocess(self._host, self._port,
self._username)
self._sftp = SFTPClient(sock)
@@ -692,7 +689,7 @@
:param relpath: The relative path, where the file should be
opened
"""
- path = self._abspath(relpath)
+ path = self._sftp._adjust_cwd(self._abspath(relpath))
attr = SFTPAttributes()
mode = (SFTP_FLAG_WRITE | SFTP_FLAG_CREATE
| SFTP_FLAG_TRUNC | SFTP_FLAG_EXCL)
More information about the bazaar
mailing list