From c88a1efca985a39607ba726115837d40803ceeea Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 12 Oct 2021 14:43:40 -0700 Subject: Update caremap to by py3 compatible Py3 doesn't mix bytes/str, so be explicit about which one Test: th Change-Id: Ia091b8378da93f19c3eb7c944199163aa9c63de7 --- update_verifier/care_map_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update_verifier/care_map_generator.py b/update_verifier/care_map_generator.py index c6f2dad24..b1396a43c 100644 --- a/update_verifier/care_map_generator.py +++ b/update_verifier/care_map_generator.py @@ -111,14 +111,14 @@ def main(argv): logging.basicConfig(level=logging.INFO if args.verbose else logging.WARNING, format=logging_format) - with open(args.input_care_map, 'r') as input_care_map: + with open(args.input_care_map, 'rb') as input_care_map: content = input_care_map.read() if args.parse_proto: result = ParseProtoMessage(content, args.fingerprint_enabled).encode() else: care_map_proto = GenerateCareMapProtoFromLegacyFormat( - content.rstrip().splitlines(), args.fingerprint_enabled) + content.decode().rstrip().splitlines(), args.fingerprint_enabled) result = care_map_proto.SerializeToString() with open(args.output_file, 'wb') as output: -- cgit v1.2.3