I sometimes get an error when I fetch the comments from answers
It complains of missing key user_id, so the json must have an owner attr but the owner not have a user_id. this was the json that failed so explains the error, I added try / except but it would nice to know about the issue (closed user account?)
{'display_name': 'user****', 'user_type': 'does_not_exist'}
if hasattr(json, 'owner'):
try:
self.owner_id = json.owner['owner_id'] if 'owner_id' in json.owner else json.owner['user_id']