I may assume the next:
robin_stocks.robinhood.authentication.login
https://robin-stocks.readthedocs.io/en/latest/_modules/robin_stocks/robinhood/authentication.html if 'access_token' in data:
token = '{0} {1}'.format(data['token_type'], data['access_token'])
update_session('Authorization', token)
set_login_state(True)
data['detail'] = "logged in with brand new authentication code."
if store_session:
with open(pickle_path, 'wb') as f:
pickle.dump({'token_type': data['token_type'],
'access_token': data['access_token'],
'refresh_token': data['refresh_token'],
'device_token': payload['device_token']}, f) else:
raise Exception(data['detail'])
so, I think access_token
is not in data
and part raise Exception(data['detail'])
is invoked, but your data does not contain detail
field and KeyError: 'detail'
is raised.