Repository: PyGithub/PyGithub

Issue:
add_to_assignees() breaks create_review_request()
Given a PullRequest object `pull`, the following sequence of operations leads to a 404 error:

1. `pull.add_to_assignees("fpoli")`
2. `pull.create_review_request(reviewers=["some-user"])`

However, the following works fine:

1. `deepclone(pull).add_to_assignees("fpoli")`
2. `pull.create_review_request(reviewers=["some-user"])`

Possible reason: internally, `add_to_assignees` calls the `_useAttributes` defined in the `Issue` class, which replaces the `self._url` of the pull request with the url of an _issue_. Then, the `create_review_request` call fails because it sends a POST request to a non-existing endpoint like <https://api.github.com/repos/viperproject/viperserver/issues/10/requested_reviewers>, which should be <https://api.github.com/repos/viperproject/viperserver/pulls/10/requested_reviewers>.


Discussion:
I've failed to reproduce this. Are you able to give me a short example that fails reproducibly?
Version: `PyGithub==1.46`

Code:
```
github = Github(os.environ["GITHUB_ACCESS_TOKEN"])
repo = github.get_repo("fpoli/test")
pull = repo.create_pull(
    title="PR title",
    body="PR body",
    base="master",
    head="new-feature",
)

print("Before:", pull._url.value)
pull.add_to_assignees("fpoli")
print("After:", pull._url.value)

pull.create_review_request(reviewers=["fpoli"])
```

Output:
```
Before: https://api.github.com/repos/fpoli/test/pulls/3
After: https://api.github.com/repos/fpoli/test/issues/3
Traceback (most recent call last):
  File "./main.py", line 18, in <module>
    pull.create_review_request(reviewers=["fpoli"])
  File "/home/fpoli/.local/lib/python3.5/site-packages/github/PullRequest.py", line 485, in create_review_request
    "POST", self.url + "/requested_reviewers", input=post_parameters
  File "/home/fpoli/.local/lib/python3.5/site-packages/github/Requester.py", line 319, in requestJsonAndCheck
    verb, url, parameters, headers, input, self.__customConnection(url)
  File "/home/fpoli/.local/lib/python3.5/site-packages/github/Requester.py", line 342, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "https://developer.github.com/v3"}
```

Resolving patch:
diff --git a/github/PullRequest.py b/github/PullRequest.py
--- a/github/PullRequest.py
+++ b/github/PullRequest.py
@@ -872,7 +872,8 @@ def add_to_assignees(self, *assignees):
         headers, data = self._requester.requestJsonAndCheck(
             "POST", self.issue_url + "/assignees", input=post_parameters
         )
-        self._useAttributes(data)
+        # Only use the assignees attribute, since we call this PR as an issue
+        self._useAttributes({"assignees": data["assignees"]})
 
     def remove_from_assignees(self, *assignees):
         """
@@ -895,7 +896,8 @@ def remove_from_assignees(self, *assignees):
         headers, data = self._requester.requestJsonAndCheck(
             "DELETE", self.issue_url + "/assignees", input=post_parameters
         )
-        self._useAttributes(data)
+        # Only use the assignees attribute, since we call this PR as an issue
+        self._useAttributes({"assignees": data["assignees"]})
 
     def update_branch(self, expected_head_sha=github.GithubObject.NotSet):
         """


Test patch:
diff --git a/tests/PullRequest.py b/tests/PullRequest.py
--- a/tests/PullRequest.py
+++ b/tests/PullRequest.py
@@ -365,16 +365,19 @@ def testAddAndRemoveAssignees(self):
         self.assertListKeyEqual(
             self.pull.assignees, lambda a: a.login, ["stuglaser", "jacquev6"]
         )
+        url = self.pull.url
         self.pull.add_to_assignees(user1, user2)
         self.assertListKeyEqual(
             self.pull.assignees,
             lambda a: a.login,
             ["jacquev6", "stuglaser", "jayfk", "jzelinskie"],
         )
+        self.assertEqual(self.pull.url, url)
         self.pull.remove_from_assignees(user1, user2)
         self.assertListKeyEqual(
             self.pull.assignees, lambda a: a.login, ["jacquev6", "stuglaser"]
         )
+        self.assertEqual(self.pull.url, url)
 
     def testUpdateBranch(self):
         self.assertTrue(
diff --git a/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt b/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt
--- a/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt
+++ b/tests/ReplayData/PullRequest.testAddAndRemoveAssignees.txt
@@ -18,7 +18,7 @@ None
 {"assignees":["jayfk","jzelinskie"]}
 201
 [('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d135d74d2ea2159d044676a220d41d3a"'), ('date', 'Sun, 27 May 2012 09:04:06 GMT'), ('content-type', 'application/json; charset=utf-8')]
-{"updated_at":"2012-05-26T14:59:33Z","body":"Body edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31","comments":0,"milestone":{"creator":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/1","number":1,"title":"Version 0.4","due_on":"2012-03-13T07:00:00Z","open_issues":0,"created_at":"2012-03-08T12:22:10Z","state":"closed","description":"","id":93546,"closed_issues":3},"number":31,"closed_by":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"assignee":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"assignees":[{"login":"jacquev6","id": 327146,"avatar_url":"https://avatars.githubusercontent.com/u/327146?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquev6"},{"login":"stuglaser","id": 1527117,"avatar_url":"https://avatars.githubusercontent.com/u/1527117?v=3","gravatar_id":"","url":"https://api.github.com/users/stuglaser"},{"login":"jayfk","id": 2930472,"avatar_url":"https://avatars.githubusercontent.com/u/2930472?v=3","gravatar_id":"","url":"https://api.github.com/users/jayfk"},{"login":"jzelinskie","id": 343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie"}],"closed_at":"2012-05-26T14:59:33Z","title":"Issue created by PyGithub","labels":[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management","name":"Project management","color":"444444"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question","name":"Question","color":"02e10c"}],"created_at":"2012-05-19T10:38:23Z","state":"closed","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":4653757,"pull_request":{"patch_url":null,"diff_url":null,"html_url":null},"html_url":"https://github.com/jacquev6/PyGithub/issues/31"}
+{"updated_at":"2012-05-26T14:59:33Z","body":"Body edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/31","comments":0,"milestone":{"creator":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/1","number":1,"title":"Version 0.4","due_on":"2012-03-13T07:00:00Z","open_issues":0,"created_at":"2012-03-08T12:22:10Z","state":"closed","description":"","id":93546,"closed_issues":3},"number":31,"closed_by":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"assignee":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"assignees":[{"login":"jacquev6","id": 327146,"avatar_url":"https://avatars.githubusercontent.com/u/327146?v=3","gravatar_id":"","url":"https://api.github.com/users/jacquev6"},{"login":"stuglaser","id": 1527117,"avatar_url":"https://avatars.githubusercontent.com/u/1527117?v=3","gravatar_id":"","url":"https://api.github.com/users/stuglaser"},{"login":"jayfk","id": 2930472,"avatar_url":"https://avatars.githubusercontent.com/u/2930472?v=3","gravatar_id":"","url":"https://api.github.com/users/jayfk"},{"login":"jzelinskie","id": 343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie"}],"closed_at":"2012-05-26T14:59:33Z","title":"Issue created by PyGithub","labels":[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management","name":"Project management","color":"444444"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question","name":"Question","color":"02e10c"}],"created_at":"2012-05-19T10:38:23Z","state":"closed","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":4653757,"pull_request":{"patch_url":null,"diff_url":null,"html_url":null},"html_url":"https://github.com/jacquev6/PyGithub/issues/31"}
 
 https
 DELETE