~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

merge in trunk and i18n-errors

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)