Skip to content

Pagination/iteration bug: infinite loop after hitting end of results #17

@adamJLev

Description

@adamJLev

To reproduce:

sem3 = Products('api_key', 'api_secret')
sem3.products_field('search', 'whatever')
sem3.products_field('cat_id', '4798')

for data in sem3.iter():
    pass
    # After end of results has been reached, this loop will go on forever

Here's what the API returns after the offset is higher than the number of results:

{u'code': u'OK',
 u'message': u'No results found; please modify your request.',
 u'offset': 505,
 u'results': [],
 u'results_count': 0,
 u'total_results_count': 722}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions