Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to handle empty intermediate responses from miser mode #194

Closed
danmichaelo opened this issue Jul 31, 2018 · 0 comments
Closed

Fails to handle empty intermediate responses from miser mode #194

danmichaelo opened this issue Jul 31, 2018 · 0 comments

Comments

@danmichaelo
Copy link
Member

When using the gcmnamespace filter with generator=categorymembers, there is a note in the ApiSandbox:

Note: Due to miser mode, using this may result in fewer than cmlimit results returned before continuing; in extreme cases, zero results may be returned.

Turns out the zero result responses do not include the 'query' key at all:

~/projects/wp/mwclient/mwclient/listing.py in set_iter(self, data)
    109     def set_iter(self, data):
    110         """Set `self._iter` to the API response `data`."""
--> 111         if self.result_member not in data['query']:
    112             self._iter = iter(six.moves.range(0))
    113         elif type(data['query'][self.result_member]) is list:

KeyError: 'query'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant