releasetools: Make common Python 3 compatible.
Bug: 131631303
Test: TreeHugger
Test: `python -m unittest test_common`
Test: `python3 -m unittest test_common`
Change-Id: I409fe30a5d71975c1d7b66e5e749843de530f1f9
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 37d5d27..5d99c99 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -44,7 +44,7 @@
"""Constructs and returns a File object. Rounds up its size if needed."""
assert os.path.exists(unpacked_name)
- with open(unpacked_name, 'r') as f:
+ with open(unpacked_name, 'rb') as f:
file_data = f.read()
file_size = len(file_data)
if round_up: