diff options
author | Richard Ipsum <richardipsum@fastmail.co.uk> | 2017-02-12 15:08:32 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-03-25 16:51:13 +0200 |
commit | 221100c22b2d96fcdada86594753b1df51626c3e (patch) | |
tree | 94afdc9a87f6eeda45faeb3b7720e69f727abd3d | |
parent | 1deb1e765f81c5ec8e66cfcaa9df1c7cb986459f (diff) | |
download | obnam-221100c22b2d96fcdada86594753b1df51626c3e.tar.gz |
Use f.truncate to make hole at end
-rw-r--r-- | obnamlib/plugins/restore_plugin.py | 5 |
1 files changed, 1 insertions, 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 |