From ca45d7a85d5eaf09ba8684f09440e8706ab190ca Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Fri, 21 Apr 2023 09:46:47 -0700 Subject: [PATCH] Fix incremental OTA generation failures source_file might be a directory, use the _ReadApexInfo() helper function to read it instead of go straight to zipfiles. Test: build incremental OTA for pixel Bug: 279142680 Bug: 227848550 Bug: 277028723 Change-Id: Ia0041e2c72c1a57123519c970f6e734194a81cd2 --- tools/releasetools/ota_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/releasetools/ota_utils.py b/tools/releasetools/ota_utils.py index 80a6c7a39b..3291d56328 100644 --- a/tools/releasetools/ota_utils.py +++ b/tools/releasetools/ota_utils.py @@ -642,8 +642,7 @@ def ConstructOtaApexInfo(target_zip, source_file=None): if not source_file: return target_apex_string - with zipfile.ZipFile(source_file, "r", allowZip64=True) as source_zip: - source_apex_string = _ReadApexInfo(source_zip) + source_apex_string = _ReadApexInfo(source_file) if not source_apex_string: return target_apex_string