DreadPirateShawn / goodreads

:snake: Python wrapper for Goodreads API :books:
0 stars 0 forks source link

Reviews are returned as single dict rather than list if only one is present in a shelf #14

Closed DreadPirateShawn closed 5 years ago

DreadPirateShawn commented 5 years ago

When a shelf contains only a single item (or for instance the last page of a shelf does), then it's returned as a single dict rather than a list of dicts.

Example URL (although this will undoubtedly stop repro'ing as content changes): https://www.goodreads.com/review/list/18761398.xml?v=2&page=3&shelf=3-star

This is ultimately an xml issue, since the spec does not disambiguate "always single child" vs "list that happens to be a single item". See https://github.com/martinblech/xmltodict/issues/14 for discussion, and see https://stackoverflow.com/a/39068400/128977 for a workaround in newer xmltodict versions.