From eb004f240f5c3e0a45bdc49f5bb6496eb5d019b4 Mon Sep 17 00:00:00 2001 From: Andrew Somerville Date: Sat, 20 May 2017 22:17:45 -0400 Subject: [PATCH] go back to text file open so that jason.load works, otherwise causes TypeError exception 'TypeError: the JSON object must be str, not \'bytes\'' --- hangouts_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hangouts_parser.py b/hangouts_parser.py index bbd6daa..cd59857 100644 --- a/hangouts_parser.py +++ b/hangouts_parser.py @@ -18,7 +18,7 @@ def parse_input_file(self, hangouts_file_name, user_phone_number): """ conversations = [] self_gaia_id = None # gaia_id for the phone owner - with open(hangouts_file_name, 'rb') as data_file: + with open(hangouts_file_name, 'r') as data_file: # Read the Hangouts JSON file and turn into objects data = json.load(data_file, object_hook=lambda d: Namespace(**d)) # Iterate through each conversation in the list