Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Comments returned for PullRequest #59

nixoz2k7 opened this issue Aug 21, 2012 · 7 comments

No Comments returned for PullRequest #59

nixoz2k7 opened this issue Aug 21, 2012 · 7 comments


Copy link

@nixoz2k7 nixoz2k7 commented Aug 21, 2012

Hello, here is the problem.
No Comments returned. But comments count showing proper value.

p = z.pulls[1]
OUTPUT: <github.PullRequest.PullRequest object at 0x104e6e5d0>
OUTPUT: u'\u041d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c =)'
OUTPUT: <github.PaginatedList.PaginatedList instance at 0x104cd6c68>

Any ideas ?

Copy link

@jacquev6 jacquev6 commented Aug 21, 2012


I confirm that the following code exhibits the same issue:

import github

g = github.Github()
r = g.get_user( "jacquev6" ).get_repo( "PyGithub" )
p = r.get_pull( 57 )
print p.title, "has", p.comments, "comments"
print [ c.body[ :15 ] for c in p.get_comments() ]

It prints:

Allows connection to GitHub Enterprise installs on local URLs has 2 comments

This last line calls API, as documented in, but the API returns an empty list. I've just managed to get the comments by calling instead. The issue must be on Github's side.

As a temporary work-around, you can use the following code to do as if the pull request is an issue, and call the other API:

print [ c.body[ :15 ] for c in r.get_issue( p.number ).get_comments() ]

Right now, I have not enough time to take care of this problem, but if it's still here at the beginning of September, I will contact Github and/or patch PyGithub.


@ghost ghost assigned jacquev6 Aug 21, 2012
Copy link

@bilderbuchi bilderbuchi commented Aug 22, 2012

To enhance the workaround a bit, you can do this to determine if an issue is a PR or not (because all PRs are issues, too):

        if myIssue.pull_request.diff_url:

Copy link

@nixoz2k7 nixoz2k7 commented Aug 22, 2012

Thank you! Will use this as a workaround.

Copy link

@jacquev6 jacquev6 commented Sep 3, 2012

I've just contacted Github for this issue.

Copy link

@jacquev6 jacquev6 commented Sep 5, 2012

And here is the reply I received from Github:

From: Wynn Netherland
Subject: API v3, list comments on pull requests

Hi, Vincent. I know it's confusing but we actually have three types of comments on GitHub, so there are
three different spots in the API to grab them. Be sure you're looking in the right spot for the data you expect.

Pull Request comments are the top-level comments found on the Pull Request page. These are retrieved via
the Issues API [1] since PRs are essentially specialized Issues. Pull Request review comments are those made
against the diff on the PR. You can grab these with the Review Comments API [2]. Finally, line comments made
outside the context of a PR on a raw commit can be retrieved via the Commit Comments API [3].

Armed with that info, let me know if you're not seeing the data you expect and the API call you're making, and I
can dig a bit deeper.



So, this is coherent with what we can see here: #57, as PullRequest.get_comments uses the Pull Requests API. @nixoz2k7 Is it coherent with your original issue as well?

Anyway, this is misleading, so I will add two methods named get_issue_comments (using the Issues API) and get_review_comments (synonym for get_comments, using the Pull Requests API). Expect this for the middle of next week.

Copy link

@jacquev6 jacquev6 commented Sep 8, 2012

I've just pushed the new methods on I close the issue because I feel it's solved. @nixoz2k7, do not hesitate to re-open it if you still have a problem with what has been said.

@jacquev6 jacquev6 closed this Sep 8, 2012
Copy link

@nixoz2k7 nixoz2k7 commented Sep 8, 2012

Thank you so much ;)
btw, it works great with "issues" workaround. stable for 2 weeks already.

Thank you again.

@nixoz2k7 nixoz2k7 added the v1 label Mar 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants