buf = tarinfo.tobuf(self.format, self.encoding, self.errors)
self.fileobj.write(buf)
self.offset += len(buf)
- self._dbg(1, 'tarinfo has size {}'.format(len(buf)))
if self.max_volume_size:
if isinstance(self.fileobj, _Stream):
# write new volume header
buf = tarinfo.tobuf(self.format, self.encoding, self.errors)
- self._dbg(1, 'tarinfo has size {}'.format(len(buf)))
self.fileobj.write(buf)
self.offset += len(buf)
# now, all data has been written. We may have to fill up the rest of
# the block in target with 0s
remainder = (tarinfo.size - tarinfo.volume_offset) % BLOCKSIZE
- self._dbg(1, 'wrote everything, fill with {} 0s to {}'
- .format(BLOCKSIZE - remainder, BLOCKSIZE))
if remainder > 0:
self.fileobj.write(NUL * (BLOCKSIZE - remainder))
self.offset += BLOCKSIZE - remainder