~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-02 15:18:06 UTC
  • mfrom: (6123.1.2 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6131.
  • Revision ID: jriddell@canonical.com-20110902151806-cfoo1xngu3xchwa9
mergeĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
    def open_write_stream(self, relpath, mode=None):
331
331
        """See Transport.open_write_stream."""
332
332
        abspath = self._abspath(relpath)
333
 
        handle = osutils.open_file(abspath, 'wb')
 
333
        try:
 
334
            handle = osutils.open_file(abspath, 'wb')
 
335
        except (IOError, OSError),e:
 
336
            self._translate_error(e, abspath)
334
337
        handle.truncate()
335
338
        if mode is not None:
336
339
            self._check_mode_and_size(abspath, handle.fileno(), mode)