From 221100c22b2d96fcdada86594753b1df51626c3e Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Sun, 12 Feb 2017 15:08:32 +0000 Subject: Use f.truncate to make hole at end --- obnamlib/plugins/restore_plugin.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/obnamlib/plugins/restore_plugin.py b/obnamlib/plugins/restore_plugin.py index 7075f82c..e7ef65f0 100644 --- a/obnamlib/plugins/restore_plugin.py +++ b/obnamlib/plugins/restore_plugin.py @@ -335,10 +335,7 @@ class RestorePlugin(obnamlib.ObnamPlugin): hole_at_end = False self.app.ts['current-bytes'] += len(data) if hole_at_end: - pos = f.tell() - if pos > 0: - f.seek(-1, 1) - f.write('\0') + f.truncate() def verify_chunk_checksum(self, data, chunk_id): # FIXME: RepositoryInterface doesn't currently seem to provide -- cgit v1.2.1