~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Vincent Ladeuil
  • Date: 2010-03-05 08:55:12 UTC
  • mfrom: (4797.2.27 2.1-integration)
  • mto: This revision was merged to the branch mainline in revision 5075.
  • Revision ID: v.ladeuil+lp@free.fr-20100305085512-rsguvvb02fbyx7zj
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