sha,
struct.pack('!I', crc),
data))
- (self._bwcount, self._bwtime) = \
- _raw_write_bwlimit(self.file, outbuf, self._bwcount, self._bwtime)
+ try:
+ (self._bwcount, self._bwtime) = _raw_write_bwlimit(
+ self.file, outbuf, self._bwcount, self._bwtime)
+ except IOError, e:
+ raise ClientError, e, sys.exc_info()[2]
self.outbytes += len(data) - 20 - 4 # Don't count sha1+crc
self.count += 1
bup repositories are in Git format. This library allows us to
interact with the Git data structures.
"""
-import os, zlib, time, subprocess, struct, stat, re, tempfile, heapq
+import os, sys, zlib, time, subprocess, struct, stat, re, tempfile, heapq
from bup.helpers import *
from bup import _helpers
# to our hashsplit algorithm.) f.write() does its own buffering,
# but that's okay because we'll flush it in _end().
oneblob = ''.join(datalist)
- f.write(oneblob)
+ try:
+ f.write(oneblob)
+ except IOError, e:
+ raise GitError, e, sys.exc_info()[2]
nw = len(oneblob)
crc = zlib.crc32(oneblob) & 0xffffffff
self._update_idx(sha, crc, nw)