pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
401 stars 124 forks source link

AbstractRetrieval(..., view="REF") sometimes breaks when there are no references #327

Closed Michael-E-Rose closed 3 months ago

Michael-E-Rose commented 3 months ago

Code to reproduce the bug:

ab = AbstractRetrieval("2-s2.0-0031874638", view="REF")

results immediately in a TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'.

Expected behavior: The class should at least initiate

Solution:

The problem is related to how the paginated retrieval of references in the REF view:

n = int(parse_content.chained_get(res, path_total_references))

Either we change the default value, or we use a try-except, or something else. But it needs to be tested.