Using SFTP pull on Win32

Matt Lavin matt.lavin at gmail.com
Thu Nov 10 22:55:31 GMT 2005


I've recently grabbed the 0.6 version of bzr to test out the new SFTP 
support and I was wondering how well it works on Windows.  Everything 
I've tried so far seems to work, after I applied a single change.  
Whenever bzr connects to my sftp server and tries to prompt me for a 
password I get an error about how getpass() fails when displaying 
unicode characters.  I tracked the problem down to _username, and _host 
are unicode, but putch() only accepts chars.  I should have copied the 
error message before fixing it, but I can reproduce it again if somebody 
needs it.  The change I made to make it work on my machine is to wrap 
the two arguments in str() calls to convert them back to non-unicode 
format.  I'm not sure how well this would work if the username has 
unicode characters, but I thought I should post to the list in case 
somebody else can have a nice solution.  In the end, I changed a line in 
bzrlib/transport/sftp.py from

        password = getpass.getpass('SSH %s@%s password: ' % 
(self._username, self._host))

 to

      password = getpass.getpass('SSH %s@%s password: ' % 
(str(self._username), str(self._host)))





More information about the bazaar mailing list