Fix python3 compatibility issues
Python3 expects write() to accept bytes or str, depending on file type(w
or wb). Since zipfile returns bytes, we must open output file with "wb",
which is the default.
Test: python3 update_device.py some_ota.zip
Change-Id: I9f163341921d7681988ee1eb01e98f0ecd5e98c9
diff --git a/scripts/update_device.py b/scripts/update_device.py
index 348c3b7..430988c 100755
--- a/scripts/update_device.py
+++ b/scripts/update_device.py
@@ -464,7 +464,7 @@
if CARE_MAP_ENTRY_NAME in zfp.namelist() and not args.no_care_map:
# Need root permission to push to /data
dut.adb(["root"])
- with tempfile.NamedTemporaryFile("w+") as care_map_fp:
+ with tempfile.NamedTemporaryFile() as care_map_fp:
care_map_fp.write(zfp.read(CARE_MAP_ENTRY_NAME))
care_map_fp.flush()
dut.adb(["push", care_map_fp.name,