properly restart compression when encrypting
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 24 Apr 2017 13:04:38 +0000 (15:04 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 2 Apr 2018 11:34:08 +0000 (13:34 +0200)
commita0873dcc8068f363c5ac730a9f25f4482295b130
tree96e22319ab896fdd9e445693c916c1efa642183b
parentb07633d35509b42a6ec337a9d9bc5228a077d6aa
properly restart compression when encrypting

Separate finalization of a zlib block from creation of a new one.
Otherwise, we end up with trailing data from the last object that
lingers in the write buffer and gets flushed to the archive after
the next encrypted object has been initialized.

Also get rid of the “new_compression_block” wrapper which
needlessly complicated things.

Special precautions must be taken for the PAX format. Due to its
requirement of a global archive header, TarFile will write to the
stream prior to initialization that is performed in addfile().
Thus, initialize compression before the PAX header is being
written and properly restart compression for the first object
committed to the archive or volume.
deltatar/deltatar.py
deltatar/tarfile.py
testing/__init__.py