-
Notifications
You must be signed in to change notification settings - Fork 31
AttributeError: 'Response' object has no attribute 'json' #33
Description
=== I just installed onedrive-cli but every command I make comes up with the following error:
AttributeError: 'Response' object has no attribute 'json'
=== For example:
$ onedrive-cli auth
Visit the following URL in any web browser (firefox, chrome, safari, etc),
authorize there, confirm access permissions, and paste URL of an empty page
(starting with "https://login.live.com/oauth20_desktop.srf") you will get redirected to in the end.
Alternatively, use the returned (after redirects) URL with "/usr/local/bin/onedrive-cli auth " command.
URL after last redirect: https://login.live.com/oauth20_desktop.srf?code=xxxxxxxx-aed1-11e0-b4be-xxxxxxxxxxxx&lc=xxxx
Traceback (most recent call last):
File "/usr/local/bin/onedrive-cli", line 9, in
load_entry_point('python-onedrive==14.11.0', 'console_scripts', 'onedrive-cli')()
File "/usr/local/lib/python2.7/dist-packages/onedrive/cli_tool.py", line 263, in main
api.auth_get_token()
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 539, in auth_get_token
ret = super(PersistentOneDriveAPI, self).auth_get_token(_argz, *_kwz)
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 238, in auth_get_token
res = self.auth_access_data_raw = self._auth_token_request()
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 271, in _auth_token_request
return self.request(self.auth_url_token, method='post', data=post_data)
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 173, in request
res = res.json()
AttributeError: 'Response' object has no attribute 'json'
=== Here is my .lcrc, it seemed to have put the auth code into the .lcrc correctly. I don't know if I should put the "-MG1SRN" after the secret but it did not seem to matter either way.
auth:
code: xxxxxxxx-aed1-11e0-b4be-xxxxxxxxxxxx
client:
id: 0000000048xxxxxx
secret: xxxxgGtrgkbbx5n3xbxxxxxxxxxxxxx-MG1SRN
=== Since the .lcrc looked correct I tried the quota command and also get the same error:
$ onedrive-cli --debug quota
DEBUG:onedrive.api_v5:Requesting new access_token through authorization_code grant
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): login.live.com
DEBUG:requests.packages.urllib3.connectionpool:"POST /oauth20_token.srf HTTP/1.1" 400 127
Traceback (most recent call last):
File "/usr/local/bin/onedrive-cli", line 9, in
load_entry_point('python-onedrive==14.11.0', 'console_scripts', 'onedrive-cli')()
File "/usr/local/lib/python2.7/dist-packages/onedrive/cli_tool.py", line 267, in main
df, ds = map(size_units, api.get_quota())
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 502, in get_quota
super(OneDriveAPI, self).get_quota()))
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 357, in get_quota
return self('me/skydrive/quota')
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 349, in call
self.auth_get_token()
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 539, in auth_get_token
ret = super(PersistentOneDriveAPI, self).auth_get_token(_argz, *_kwz)
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 238, in auth_get_token
res = self.auth_access_data_raw = self._auth_token_request()
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 271, in _auth_token_request
return self.request(self.auth_url_token, method='post', data=post_data)
File "/usr/local/lib/python2.7/dist-packages/onedrive/api_v5.py", line 173, in request
res = res.json()
AttributeError: 'Response' object has no attribute 'json'