- Notifications
You must be signed in to change notification settings - Fork676
Closed
Description
Description of the problem, including code/CLI snippet
Pull request#1110 that has been released in v2.3.0 yesterday introduced a regression on a specific scenario:
when callinglen()
on the output ofGitlab().projects.list(as_list=False)
.
Expected Behavior
Being able to calllen()
on the iterator returned byGitlab().projects.list(as_list=False)
Actual Behavior
Minimal reproduction code:
importgitlablen(gitlab.Gitlab(...).projects.list(as_list=False))
Output:
Traceback (most recent call last): File "test.py", line 3, in <module> len(gitlab.Gitlab(...).projects.list(as_list=False))#, pagination='offset')) File ".../lib/python3.7/site-packages/gitlab/base.py", line 184, in __len__ return len(self._list) File ".../lib/python3.7/site-packages/gitlab/__init__.py", line 863, in __len__ return int(self._total)TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Workaround:
importgitlablen(gitlab.Gitlab(...).projects.list(as_list=False,pagination='offset'))
Specifications
- python-gitlab version: sicnce v2.3.0
- API version you are using (v3/v4): v4
- Gitlab server version (or gitlab.com): 12.10.7-ee (80b99e43cfc)
Metadata
Metadata
Assignees
Labels
No labels