~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/stub_sftp.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-02 17:16:12 UTC
  • mto: This revision was merged to the branch mainline in revision 5369.
  • Revision ID: john@arbash-meinel.com-20100802171612-rdh5ods70w2bl3j7
We also have to re-implement it for _simple_set_pyx.pyx

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
        try:
136
136
            out = [ ]
137
137
            # TODO: win32 incorrectly lists paths with non-ascii if path is not
138
 
            # unicode. However on Linux the server should only deal with
 
138
            # unicode. However on unix the server should only deal with
139
139
            # bytestreams and posix.listdir does the right thing
140
140
            if sys.platform == 'win32':
141
141
                flist = [f.encode('utf8') for f in os.listdir(path)]
446
446
                'the local current working directory.' % (backing_server,))
447
447
        self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor
448
448
        ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor
449
 
        # FIXME: the following block should certainly just be self._homedir =
450
 
        # osutils.getcwd() but that fails badly on Unix -- vila 20100224
451
449
        if sys.platform == 'win32':
452
450
            # Win32 needs to use the UNICODE api
453
451
            self._homedir = os.getcwdu()
 
452
            # Normalize the path or it will be wrongly escaped
 
453
            self._homedir = osutils.normpath(self._homedir)
454
454
        else:
455
 
            # But Linux SFTP servers should just deal in bytestreams
 
455
            # But unix SFTP servers should just deal in bytestreams
456
456
            self._homedir = os.getcwd()
457
457
        if self._server_homedir is None:
458
458
            self._server_homedir = self._homedir