~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: 2011-08-31 19:39:37 UTC
  • mfrom: (6110.3.2 nosuchfile)
  • Revision ID: pqm@pqm.ubuntu.com-20110831193937-tl38nsd3y1pe8s3w
(jelmer) Properly translate IOErrors from open_file in
 LocalTransport.open_write_stream. (Jelmer Vernooij)

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)