atlassian-api / atlassian-python-api

Atlassian Python REST API wrapper
https://atlassian-python-api.readthedocs.io
Apache License 2.0
1.29k stars 642 forks source link

bitbucket.project_list() only returns generators #1408

Closed pascalrobert closed 3 weeks ago

pascalrobert commented 3 weeks ago

Using Bitbucket 8.19 and Python 3.12. When I call bitbucket.project_list(), it returns a list of the correct length. But if I print it, it only show 'generator object'. If I iterate over the list with:

project_list = bitbucket.project_list() for project in project_list: print(project)

I see the details, but it's a infinite loop, it's just iterate over and over again on the list of projects (1398 x X loops).

Spacetown commented 3 weeks ago

The generator is intended. How did you get the length of the list without iterating?

pascalrobert commented 3 weeks ago

I'm just plain stupid. My function was called in a loop, so it was really iterating many times because bitbucket.project_list() was called many times... Working fine now.

Spacetown commented 3 weeks ago

???