From: Eduardo Robles Elvira Date: Thu, 17 Oct 2013 18:21:42 +0000 (+0200) Subject: fixing aes only mode: it turns out we were not closing correctly the aes stream X-Git-Tag: v2.2~84 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=f7ababc0bd7b2ce72d42686930453e8f6f2909e2;p=python-delta-tar fixing aes only mode: it turns out we were not closing correctly the aes stream --- 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("