From 59b03f0d36bc8315bcf8279cf6f1cad533453589 Mon Sep 17 00:00:00 2001 From: nergall2 <63109814+nergall2@users.noreply.github.com> Date: Fri, 3 Apr 2020 18:05:08 +0300 Subject: [PATCH] bop-40105: fixed zip comment update --- Lib/zipfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/zipfile.py b/Lib/zipfile.py index c3f814cc747e06..af42fd8df21486 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -1919,6 +1919,7 @@ def _write_end_record(self): centDirSize, centDirOffset, len(self._comment)) self.fp.write(endrec) self.fp.write(self._comment) + self.fp.truncate() self.fp.flush() def _fpclose(self, fp):