You are trying to use an attribute that is not included in PaginatedList
. For more info: link
To get comments from issues, you need to extract all comments from a single issue, and keep doing that for every issue. This line is not is not achieving that c = i.get_comments()
. I located this question which has a solution for the behavior you're looking for: link
Also, there's a couple of things I would like to point out in your code:
g = Github(base_url="https://github.com/api/v3", login_or_token="XXX")
This GitHub instance is for Github Enterprise with custom domain. Your URL is missing the domain name. The URL should be in this format: https://github.xxx.com/api/v3
. If you don't have Enterprise account, you could create an instance using either your login/password or a token. Reference.
Are you trying to get comments from a specific organization or from all repositories? I ask because r = g.get_repo("ORG/REPO")
returns requests from an organization. To specify all repositories instead, use g.get_repo("repositories)
. Also, note that requests are limited to 5000 requests, and you need to use Link Header to specify more. Reference
Your current code specifies comments in open issues, and doesn't consider closed issues as well. To return all comments in all issues, include open and closed issues; i = r.get_issues(state='all')
Reference