~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-03-05 09:27:03 UTC
  • mfrom: (5074.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100305092703-xwm9tmj33i3ym5rp
(vila) Merge 2.1 into bzr.dev including fixes for #524560 and #449776

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
from bzrlib import transport
43
43
 
44
44
 
45
 
_append_flags = os.O_CREAT | os.O_APPEND | os.O_WRONLY | osutils.O_BINARY
46
 
_put_non_atomic_flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | osutils.O_BINARY
 
45
_append_flags = os.O_CREAT | os.O_APPEND | os.O_WRONLY | osutils.O_BINARY | osutils.O_NOINHERIT
 
46
_put_non_atomic_flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | osutils.O_BINARY | osutils.O_NOINHERIT
47
47
 
48
48
 
49
49
class LocalTransport(transport.Transport):
160
160
            transport._file_streams[canonical_url].flush()
161
161
        try:
162
162
            path = self._abspath(relpath)
163
 
            return open(path, 'rb')
 
163
            return osutils.open_file(path, 'rb')
164
164
        except (IOError, OSError),e:
165
165
            if e.errno == errno.EISDIR:
166
166
                return LateReadError(relpath)
329
329
        # initialise the file
330
330
        self.put_bytes_non_atomic(relpath, "", mode=mode)
331
331
        abspath = self._abspath(relpath)
332
 
        handle = open(abspath, 'wb')
 
332
        handle = osutils.open_file(abspath, 'wb')
333
333
        if mode is not None:
334
334
            self._check_mode_and_size(abspath, handle.fileno(), mode)
335
335
        transport._file_streams[self.abspath(relpath)] = handle