Allow zip64 support when opening zip files

When opening an zip file through zipfile.ZipFile(), python2 by default
disables zip64 support. To support update files >4GB, we manually add
allowZip64 to override the setting.

Test: generate && serve an OTA

Change-Id: I9645e963ced830cc2d3a4b72bc63b9369a1cefe8
This commit is contained in:
Kelvin Zhang
2020-09-22 16:15:57 -04:00
parent c9e91554ee
commit 928c2341a6
16 changed files with 134 additions and 134 deletions

View File

@@ -813,7 +813,7 @@ def WriteOtacerts(output_zip, filename, keys):
keys: A list of public keys to use during OTA package verification.
"""
temp_file = io.BytesIO()
certs_zip = zipfile.ZipFile(temp_file, "w")
certs_zip = zipfile.ZipFile(temp_file, "w", allowZip64=True)
for k in keys:
common.ZipWrite(certs_zip, k)
common.ZipClose(certs_zip)
@@ -1294,7 +1294,7 @@ def main(argv):
common.InitLogging()
input_zip = zipfile.ZipFile(args[0], "r")
input_zip = zipfile.ZipFile(args[0], "r", allowZip64=True)
output_zip = zipfile.ZipFile(args[1], "w",
compression=zipfile.ZIP_DEFLATED,
allowZip64=True)