sync on .close() for unencrypted archives
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Tue, 25 Apr 2017 13:28:09 +0000 (15:28 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 2 Apr 2018 11:34:08 +0000 (13:34 +0200)
deltatar/tarfile.py

index 78fdad8..21027d0 100644 (file)
@@ -682,7 +682,11 @@ class _Stream:
                 if self.cmp is not None:
                     self._finalize_write_gz ()
                 # end of Tar archive marker (two empty blocks) was written
+                self.__sync()
+                # finalize encryption last; no writes may be performed after
+                # this point
                 self._finalize_write_encrypt ()
+
             if not self._extfileobj:
                 self.fileobj.close()
         else: