urschrei / pyzotero

Pyzotero: a Python client for the Zotero API
https://pyzotero.readthedocs.org
Other
910 stars 100 forks source link

`StopIteration` error when wrapping `top` with `makeiter` #115

Closed Mathijssch closed 4 years ago

Mathijssch commented 4 years ago

General

Platform: Ubuntu 18.04 Python version: 3.7.3 Pyzotero version: 1.4.14

Problem description

I am attempting to lazily iterate over the top-level items in my library. As a minimal test, I followed the example in the documentation and execute the following

zot = zotero.Zotero(libId, 'user', APIKey)  # Fill in valid keys
lib = zot.makeiter(zot.top(limit=5))
next(lib)  # Returns a list of 5 elements (as expected)
next(lib)  # Raises StopIteration error instead of the next 5 entries in the library. 

The StopIteration error is raised regardless of the limit I impose. (zot.num_items() returns 515).

urschrei commented 4 years ago

Oops. Fixed in 1.4.16, now on PyPI.