The following call fails with the error in the title
api = FacebookApi(...)
result = api.user.get_accounts(<authenticated_user_id>)
result.to_json() # Error occurs here
Now, that the problem is with to_json(). A similar problem happens when we try to call to_dict()