sefakilic/goodreads

None response on - owned_books

Closed this issue · 1 comments

I'm trying to implement an app that consumes the api to get all the books that a user owns, but I'm getting None response from goodreads... I don't know if it has to do with my test or something else.

Here is what I'm using to test:
from goodreads import client
key = 'xxx'
secret = 'xxx'
gc = client.GoodreadsClient(key, secret)
gc.authenticate()

Then

user = gc.user()
user.owned_books()

The response on the shell is:
INFO:requests.packages.urllib3.connectionpool:Resetting dropped connection: www.goodreads.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /owned_books/user/xxx.xml?oauth_nonce=55fca771e0550da0e82fa4c043946aadf5f57626&format=xml&oauth_consumer_key=xxx&oauth_timestamp=1458051917&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_token=iwZidyCR5ll4pWtdAbgUiQ&oauth_signature=G6Q4pav9%2BUU6283%2BBmagsBDDBU8%3D&page=1 HTTP/1.1" 200 None
Traceback (most recent call last):
File "", line 1, in
File "..../src/goodreads-api/goodreads/user.py", line 59, in owned_books
for d in resp['owned_books']['owned_book']]
TypeError: 'NoneType' object has no attribute 'getitem'

I intentionally putted "xxx" under the consumer_key and xxx under the user that I'm using, but I'm using the exact same string than the provided by goodreads.

I don't know if this is an issue with this library or with goodreads.

I've tested a bunch of other api points and they work. The only one that doesn't work for me is is the owned_books

I fixed a few things on owned_books module. Please let me know if you are still having problems.