You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
int() argument must be a string, a bytes-like object or a real number, not 'NoneType' while accessing pagination related attributes #1686
Description of the problem, including code/CLI snippet
Accessing current_page , per_page , total , total_pages attributes , throwing the following error. int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Also , related to pagination i do have specific question.
Can we implement pagination in such way that , calling the required page number ( say for example 3 will return me the 3rd page ) ,
current implementation is that i need to be in the same method , iterate through page 1 , page 2 and page 3. as long as i'm in the same function all is good.
But if i leave this function , and come back to this pagination fuction with next_page number , Is this something possible ? Atleast i could not find it in the code examples.
if you guys , have some ideas , please post it here. Appreciate your support.
I'm more than willing to do code changes as well , if you point me the right souce location. Thanks much.
Activity
JohnVillalovos commentedon Nov 10, 2021
I can't reproduce this but I only have about 90 projects.
You might try doing:
As it might help diagnose the issue.
JohnVillalovos commentedon Nov 10, 2021
Also if you can paste the full Exception stack trace it would be helpful to see what part of the code is triggering the issue.
nejch commentedon Nov 10, 2021
I think this is a duplicate of #1506 and maybe #1114, that gitlab.com keyset pagination thing again :(
VenkatsQuest commentedon Nov 10, 2021
Also , related to pagination i do have specific question.
Can we implement pagination in such way that , calling the required page number ( say for example 3 will return me the 3rd page ) ,
current implementation is that i need to be in the same method , iterate through page 1 , page 2 and page 3. as long as i'm in the same function all is good.
But if i leave this function , and come back to this pagination fuction with next_page number , Is this something possible ? Atleast i could not find it in the code examples.
if you guys , have some ideas , please post it here. Appreciate your support.
I'm more than willing to do code changes as well , if you point me the right souce location. Thanks much.
kenzliang commentedon Dec 22, 2021
+1 on this issue, debug log below. Can't seem to fetch the total pages. Seems sometimes Gitlab will not return the header
X-total-pages.python-gitlab version:2.10.1
API version you are using (v3/v4): v4
Gitlab server version (or gitlab.com):13.12.12
kenzliang commentedon Dec 22, 2021
seems to be the issue here:
https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers
fix: handle situation where gitlab.com does not return values
JohnVillalovos commentedon Dec 22, 2021
Thank you very much for the debug log and the link. That made it easy to figure out the issue. I have proposed a PR to resolve the issue.
fix: handle situation where GitLab does not return values
fix: handle situation where GitLab does not return values
fix: handle situation where GitLab does not return values
fix: handle situation where GitLab does not return values
fix: handle situation where GitLab does not return values
fix: handle situation where GitLab does not return values
fix: handle situation where GitLab does not return values