From 674e24fc41de908745784ab28dea9ec6a2addb68 Mon Sep 17 00:00:00 2001 From: tlc Date: Wed, 19 Sep 2018 18:09:24 -0400 Subject: [PATCH] Enable Zip64 (#96) --- comicapi/comicarchive.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/comicapi/comicarchive.py b/comicapi/comicarchive.py index ac7c83d..33d43f9 100644 --- a/comicapi/comicarchive.py +++ b/comicapi/comicarchive.py @@ -153,6 +153,7 @@ class ZipArchiver: zf = zipfile.ZipFile( self.path, mode='a', + allowZip64=True, compression=zipfile.ZIP_DEFLATED) zf.writestr(archive_file, data) zf.close() @@ -185,7 +186,7 @@ class ZipArchiver: os.close(tmp_fd) zin = zipfile.ZipFile(self.path, 'r') - zout = zipfile.ZipFile(tmp_name, 'w') + zout = zipfile.ZipFile(tmp_name, 'w', allowZip64=True) for item in zin.infolist(): buffer = zin.read(item.filename) if (item.filename not in exclude_list): @@ -270,7 +271,7 @@ class ZipArchiver: """Replace the current zip with one copied from another archive""" try: - zout = zipfile.ZipFile(self.path, 'w') + zout = zipfile.ZipFile(self.path, 'w', allowZip64=True) for fname in otherArchive.getArchiveFilenameList(): data = otherArchive.readArchiveFile(fname) if data is not None: