Open bugreport file in binary mode.
Change-Id: I0e856d036af63e1cb6b54b6868cdedc948fad75d
Fix: 260664367
Test: manual - run test case that will dump a bugreport.
diff --git a/stress_test.py b/stress_test.py
index 2ff487a..c77ae83 100644
--- a/stress_test.py
+++ b/stress_test.py
@@ -682,13 +682,13 @@
sdk = int(self.Command(
["shell", "getprop", "ro.build.version.sdk"]).strip())
if sdk >= 24: # SDK 24 = Android N
- with open(bugreport, "w") as bugreport_fp:
+ with open(bugreport, "wb") as bugreport_fp:
bugreport_fp.write(self.Command(["bugreport", bugreport]))
else:
bugreport_txt = os.path.join(self.output_root,
"%s_bugreport_iteration_%06d.txt" %
(self.name, self.iteration))
- with open(bugreport_txt, "w") as bugreport_fp:
+ with open(bugreport_txt, "wb") as bugreport_fp:
bugreport_fp.write(self.Command(["bugreport"]))
self.Command(["zip", bugreport, bugreport_txt])