~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/stub_sftp.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
        path = self._realpath(path)
94
94
        try:
95
95
            out = [ ]
 
96
            # TODO: win32 incorrectly lists paths with non-ascii if path is not
 
97
            # unicode. However on Linux the server should only deal with
 
98
            # bytestreams and posix.listdir does the right thing 
96
99
            flist = os.listdir(path)
97
100
            for fname in flist:
98
101
                attr = SFTPAttributes.from_stat(os.stat(pathjoin(path, fname)))
127
130
                fd = os.open(path, flags)
128
131
        except OSError, e:
129
132
            return SFTPServer.convert_errno(e.errno)
 
133
 
130
134
        if (flags & os.O_CREAT) and (attr is not None):
131
135
            attr._flags &= ~attr.FLAG_PERMISSIONS
132
136
            SFTPServer.set_file_attr(path, attr)