~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/stub_sftp.py

  • Committer: Alexander Belchenko
  • Date: 2006-07-30 16:43:12 UTC
  • mto: (1711.2.111 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1906.
  • Revision ID: bialix@ukr.net-20060730164312-b025fd3ff0cee59e
rename  gpl.txt => COPYING.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
    def open(self, path, flags, attr):
154
154
        path = self._realpath(path)
155
155
        try:
156
 
            flags |= getattr(os, 'O_BINARY', 0)
 
156
            if hasattr(os, 'O_BINARY'):
 
157
                flags |= os.O_BINARY
157
158
            if getattr(attr, 'st_mode', None):
158
159
                fd = os.open(path, flags, attr.st_mode)
159
160
            else:
160
 
                # os.open() defaults to 0777 which is
161
 
                # an odd default mode for files
162
 
                fd = os.open(path, flags, 0666)
 
161
                fd = os.open(path, flags)
163
162
        except OSError, e:
164
163
            return SFTPServer.convert_errno(e.errno)
165
164