Fix str/bytes type error in ReplaceOtaKeys
ZipFile.read() returns byte sequence, while re.match expects str. Decode the bytes read first. Test: th Bug: 315855025 Change-Id: Id2da071f3caeab56cfac845a9e4f842c4e102f49
This commit is contained in:
@@ -1156,9 +1156,9 @@ def WriteOtacerts(output_zip, filename, keys):
|
||||
common.ZipWriteStr(output_zip, filename, temp_file.getvalue())
|
||||
|
||||
|
||||
def ReplaceOtaKeys(input_tf_zip, output_tf_zip, misc_info):
|
||||
def ReplaceOtaKeys(input_tf_zip: zipfile.ZipFile, output_tf_zip, misc_info):
|
||||
try:
|
||||
keylist = input_tf_zip.read("META/otakeys.txt").split()
|
||||
keylist = input_tf_zip.read("META/otakeys.txt").decode().split()
|
||||
except KeyError:
|
||||
raise common.ExternalError("can't read META/otakeys.txt from input")
|
||||
|
||||
|
Reference in New Issue
Block a user