GearPlug / microsoftgraph-python

Microsoft Graph API wrapper written in Python
MIT License
96 stars 40 forks source link

Stack overflow in _paginate_response method #25

Closed Disruption closed 2 years ago

Disruption commented 2 years ago

The _paginate_response method in the client performs pagination via recursion:

There are a few problems with this approach:

This could be solved by calling self._request directly on the while loop inside the _paginate_response method, rather than _get, which eliminates recursion. The check for response.data being a dict instance should be performed there as well to avoid the potential exception.

ingmferrer commented 2 years ago

Hello, I appreciate if you can send a PR solving this, since you're reproducing the error.

Disruption commented 2 years ago

@ingmferrer Sure, I will do a PR with the fix after #27 is merged, since both fixes are exactly on the same line of code

Disruption commented 2 years ago

Fixed in #28