From f7ababc0bd7b2ce72d42686930453e8f6f2909e2 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Thu, 17 Oct 2013 20:21:42 +0200 Subject: [PATCH] fixing aes only mode: it turns out we were not closing correctly the aes stream --- deltatar/tarfile.py | 10 ++++++++-- runtests.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/deltatar/tarfile.py b/deltatar/tarfile.py index 1832199..5dcfe9d 100644 --- a/deltatar/tarfile.py +++ b/deltatar/tarfile.py @@ -540,7 +540,13 @@ class _Stream: def _new_aes_block(self, set_last_block_offset=False): + # this basically checks if it comes from new_compression_block() call, + # in which case we have to call to close + if self.comptype == "tar": + self.close(close_fileobj=False) + self.closed = False self.__write_to_file(self.encryption.close_enc()) + if set_last_block_offset: self.last_block_offset = self.fileobj.tell() self.encryption = aescrypto.AESCrypt(self.password, @@ -606,7 +612,6 @@ class _Stream: # it to look positive on all boxes. chunk += struct.pack("