~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/stub_sftp.py

  • Committer: Martin Pool
  • Date: 2009-03-24 05:21:02 UTC
  • mfrom: (4192 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4202.
  • Revision ID: mbp@sourcefrog.net-20090324052102-8kk087b32tep3d9h
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
    def _realpath(self, path):
84
84
        # paths returned from self.canonicalize() always start with
85
85
        # a path separator. So if 'root' is just '/', this would cause
86
 
        # a double slash at the beginning '//home/dir'. 
 
86
        # a double slash at the beginning '//home/dir'.
87
87
        if self.root == '/':
88
88
            return self.canonicalize(path)
89
89
        return self.root + self.canonicalize(path)
96
96
            #     /h:/foo/bar
97
97
            # and relative paths stay the same:
98
98
            #     foo/bar
99
 
            # win32 needs to use the Unicode APIs. so we require the 
 
99
            # win32 needs to use the Unicode APIs. so we require the
100
100
            # paths to be utf8 (Linux just uses bytestreams)
101
101
            thispath = path.decode('utf8')
102
102
            if path.startswith('/'):
124
124
            out = [ ]
125
125
            # TODO: win32 incorrectly lists paths with non-ascii if path is not
126
126
            # unicode. However on Linux the server should only deal with
127
 
            # bytestreams and posix.listdir does the right thing 
 
127
            # bytestreams and posix.listdir does the right thing
128
128
            if sys.platform == 'win32':
129
129
                flist = [f.encode('utf8') for f in os.listdir(path)]
130
130
            else: