{"action":"created","comment":{"url":"https://api.github.com/repos/kennethreitz/requests/pulls/comments/50301718","id":50301718,"diff_hunk":"@@ -188,6 +188,28 @@ def test_HTTP_302_ALLOW_REDIRECT_GET(self, httpbin):\n         assert r.history[0].status_code == 302\n         assert r.history[0].is_redirect\n \n+    def test_HTTP_302_TOO_MANY_REDIRECTS(self, httpbin):\n+        try:\n+            requests.get(httpbin('redirect', '50'))\n+        except TooManyRedirects as e:\n+            assert '/relative-redirect/20' in e.request.url\n+            assert e.request.url == e.response.url\n+            assert len(e.response.history) == 30\n+        else:\n+            pytest.fail()","path":"test_requests.py","position":21,"original_position":21,"commit_id":"6a8a480d6c535e8fd52526875296576c5309203c","original_commit_id":"6a8a480d6c535e8fd52526875296576c5309203c","user":{"login":"sigmavirus24","id":240830,"avatar_url":"https://avatars.githubusercontent.com/u/240830?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmavirus24","html_url":"https://github.com/sigmavirus24","followers_url":"https://api.github.com/users/sigmavirus24/followers","following_url":"https://api.github.com/users/sigmavirus24/following{/other_user}","gists_url":"https://api.github.com/users/sigmavirus24/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmavirus24/subscriptions","organizations_url":"https://api.github.com/users/sigmavirus24/orgs","repos_url":"https://api.github.com/users/sigmavirus24/repos","events_url":"https://api.github.com/users/sigmavirus24/events{/privacy}","received_events_url":"https://api.github.com/users/sigmavirus24/received_events","type":"User","site_admin":false},"body":"Let's say \"Expected redirect to raise TooManyRedirects but it did not\" please?","created_at":"2016-01-20T19:04:41Z","updated_at":"2016-01-20T19:04:41Z","html_url":"https://github.com/kennethreitz/requests/pull/2972#discussion_r50301718","pull_request_url":"https://api.github.com/repos/kennethreitz/requests/pulls/2972","_links":{"self":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/comments/50301718"},"html":{"href":"https://github.com/kennethreitz/requests/pull/2972#discussion_r50301718"},"pull_request":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/2972"}}},"pull_request":{"url":"https://api.github.com/repos/kennethreitz/requests/pulls/2972","id":56549729,"html_url":"https://github.com/kennethreitz/requests/pull/2972","diff_url":"https://github.com/kennethreitz/requests/pull/2972.diff","patch_url":"https://github.com/kennethreitz/requests/pull/2972.patch","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/2972","number":2972,"state":"open","locked":false,"title":"Return request & response with TooManyRedirects","user":{"login":"munro","id":500774,"avatar_url":"https://avatars.githubusercontent.com/u/500774?v=3","gravatar_id":"","url":"https://api.github.com/users/munro","html_url":"https://github.com/munro","followers_url":"https://api.github.com/users/munro/followers","following_url":"https://api.github.com/users/munro/following{/other_user}","gists_url":"https://api.github.com/users/munro/gists{/gist_id}","starred_url":"https://api.github.com/users/munro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munro/subscriptions","organizations_url":"https://api.github.com/users/munro/orgs","repos_url":"https://api.github.com/users/munro/repos","events_url":"https://api.github.com/users/munro/events{/privacy}","received_events_url":"https://api.github.com/users/munro/received_events","type":"User","site_admin":false},"body":"I'm using requests to fetch data from websites that I don't maintain, and sometimes websites have broken cyclic redirects, but still return useful responses.  So I would like to grab the last cut off response, similar to the browser.\r\n\r\nThe problem is that `TooManyRedirects` doesn't throw the ending response state for me to inspect, so this PR adds that.","created_at":"2016-01-20T00:53:26Z","updated_at":"2016-01-20T19:04:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35d30ec9a6190be2893b53adf21008088482a9f6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kennethreitz/requests/pulls/2972/commits","review_comments_url":"https://api.github.com/repos/kennethreitz/requests/pulls/2972/comments","review_comment_url":"https://api.github.com/repos/kennethreitz/requests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/2972/comments","statuses_url":"https://api.github.com/repos/kennethreitz/requests/statuses/6a8a480d6c535e8fd52526875296576c5309203c","head":{"label":"munro:master","ref":"master","sha":"6a8a480d6c535e8fd52526875296576c5309203c","user":{"login":"munro","id":500774,"avatar_url":"https://avatars.githubusercontent.com/u/500774?v=3","gravatar_id":"","url":"https://api.github.com/users/munro","html_url":"https://github.com/munro","followers_url":"https://api.github.com/users/munro/followers","following_url":"https://api.github.com/users/munro/following{/other_user}","gists_url":"https://api.github.com/users/munro/gists{/gist_id}","starred_url":"https://api.github.com/users/munro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munro/subscriptions","organizations_url":"https://api.github.com/users/munro/orgs","repos_url":"https://api.github.com/users/munro/repos","events_url":"https://api.github.com/users/munro/events{/privacy}","received_events_url":"https://api.github.com/users/munro/received_events","type":"User","site_admin":false},"repo":{"id":49992810,"name":"requests","full_name":"munro/requests","owner":{"login":"munro","id":500774,"avatar_url":"https://avatars.githubusercontent.com/u/500774?v=3","gravatar_id":"","url":"https://api.github.com/users/munro","html_url":"https://github.com/munro","followers_url":"https://api.github.com/users/munro/followers","following_url":"https://api.github.com/users/munro/following{/other_user}","gists_url":"https://api.github.com/users/munro/gists{/gist_id}","starred_url":"https://api.github.com/users/munro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munro/subscriptions","organizations_url":"https://api.github.com/users/munro/orgs","repos_url":"https://api.github.com/users/munro/repos","events_url":"https://api.github.com/users/munro/events{/privacy}","received_events_url":"https://api.github.com/users/munro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/munro/requests","description":"Python HTTP Requests for Humans™.","fork":true,"url":"https://api.github.com/repos/munro/requests","forks_url":"https://api.github.com/repos/munro/requests/forks","keys_url":"https://api.github.com/repos/munro/requests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/munro/requests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/munro/requests/teams","hooks_url":"https://api.github.com/repos/munro/requests/hooks","issue_events_url":"https://api.github.com/repos/munro/requests/issues/events{/number}","events_url":"https://api.github.com/repos/munro/requests/events","assignees_url":"https://api.github.com/repos/munro/requests/assignees{/user}","branches_url":"https://api.github.com/repos/munro/requests/branches{/branch}","tags_url":"https://api.github.com/repos/munro/requests/tags","blobs_url":"https://api.github.com/repos/munro/requests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/munro/requests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/munro/requests/git/refs{/sha}","trees_url":"https://api.github.com/repos/munro/requests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/munro/requests/statuses/{sha}","languages_url":"https://api.github.com/repos/munro/requests/languages","stargazers_url":"https://api.github.com/repos/munro/requests/stargazers","contributors_url":"https://api.github.com/repos/munro/requests/contributors","subscribers_url":"https://api.github.com/repos/munro/requests/subscribers","subscription_url":"https://api.github.com/repos/munro/requests/subscription","commits_url":"https://api.github.com/repos/munro/requests/commits{/sha}","git_commits_url":"https://api.github.com/repos/munro/requests/git/commits{/sha}","comments_url":"https://api.github.com/repos/munro/requests/comments{/number}","issue_comment_url":"https://api.github.com/repos/munro/requests/issues/comments{/number}","contents_url":"https://api.github.com/repos/munro/requests/contents/{+path}","compare_url":"https://api.github.com/repos/munro/requests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/munro/requests/merges","archive_url":"https://api.github.com/repos/munro/requests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/munro/requests/downloads","issues_url":"https://api.github.com/repos/munro/requests/issues{/number}","pulls_url":"https://api.github.com/repos/munro/requests/pulls{/number}","milestones_url":"https://api.github.com/repos/munro/requests/milestones{/number}","notifications_url":"https://api.github.com/repos/munro/requests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/munro/requests/labels{/name}","releases_url":"https://api.github.com/repos/munro/requests/releases{/id}","created_at":"2016-01-20T00:23:48Z","updated_at":"2016-01-20T00:23:50Z","pushed_at":"2016-01-20T18:48:56Z","git_url":"git://github.com/munro/requests.git","ssh_url":"git@github.com:munro/requests.git","clone_url":"https://github.com/munro/requests.git","svn_url":"https://github.com/munro/requests","homepage":"python-requests.org","size":6931,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kennethreitz:master","ref":"master","sha":"6592dbc29b4e4f76b544f523437cc88ac2943634","user":{"login":"kennethreitz","id":119893,"avatar_url":"https://avatars.githubusercontent.com/u/119893?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethreitz","html_url":"https://github.com/kennethreitz","followers_url":"https://api.github.com/users/kennethreitz/followers","following_url":"https://api.github.com/users/kennethreitz/following{/other_user}","gists_url":"https://api.github.com/users/kennethreitz/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethreitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethreitz/subscriptions","organizations_url":"https://api.github.com/users/kennethreitz/orgs","repos_url":"https://api.github.com/users/kennethreitz/repos","events_url":"https://api.github.com/users/kennethreitz/events{/privacy}","received_events_url":"https://api.github.com/users/kennethreitz/received_events","type":"User","site_admin":false},"repo":{"id":1362490,"name":"requests","full_name":"kennethreitz/requests","owner":{"login":"kennethreitz","id":119893,"avatar_url":"https://avatars.githubusercontent.com/u/119893?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethreitz","html_url":"https://github.com/kennethreitz","followers_url":"https://api.github.com/users/kennethreitz/followers","following_url":"https://api.github.com/users/kennethreitz/following{/other_user}","gists_url":"https://api.github.com/users/kennethreitz/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethreitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethreitz/subscriptions","organizations_url":"https://api.github.com/users/kennethreitz/orgs","repos_url":"https://api.github.com/users/kennethreitz/repos","events_url":"https://api.github.com/users/kennethreitz/events{/privacy}","received_events_url":"https://api.github.com/users/kennethreitz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kennethreitz/requests","description":"Python HTTP Requests for Humans™.","fork":false,"url":"https://api.github.com/repos/kennethreitz/requests","forks_url":"https://api.github.com/repos/kennethreitz/requests/forks","keys_url":"https://api.github.com/repos/kennethreitz/requests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kennethreitz/requests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kennethreitz/requests/teams","hooks_url":"https://api.github.com/repos/kennethreitz/requests/hooks","issue_events_url":"https://api.github.com/repos/kennethreitz/requests/issues/events{/number}","events_url":"https://api.github.com/repos/kennethreitz/requests/events","assignees_url":"https://api.github.com/repos/kennethreitz/requests/assignees{/user}","branches_url":"https://api.github.com/repos/kennethreitz/requests/branches{/branch}","tags_url":"https://api.github.com/repos/kennethreitz/requests/tags","blobs_url":"https://api.github.com/repos/kennethreitz/requests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kennethreitz/requests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kennethreitz/requests/git/refs{/sha}","trees_url":"https://api.github.com/repos/kennethreitz/requests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kennethreitz/requests/statuses/{sha}","languages_url":"https://api.github.com/repos/kennethreitz/requests/languages","stargazers_url":"https://api.github.com/repos/kennethreitz/requests/stargazers","contributors_url":"https://api.github.com/repos/kennethreitz/requests/contributors","subscribers_url":"https://api.github.com/repos/kennethreitz/requests/subscribers","subscription_url":"https://api.github.com/repos/kennethreitz/requests/subscription","commits_url":"https://api.github.com/repos/kennethreitz/requests/commits{/sha}","git_commits_url":"https://api.github.com/repos/kennethreitz/requests/git/commits{/sha}","comments_url":"https://api.github.com/repos/kennethreitz/requests/comments{/number}","issue_comment_url":"https://api.github.com/repos/kennethreitz/requests/issues/comments{/number}","contents_url":"https://api.github.com/repos/kennethreitz/requests/contents/{+path}","compare_url":"https://api.github.com/repos/kennethreitz/requests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kennethreitz/requests/merges","archive_url":"https://api.github.com/repos/kennethreitz/requests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kennethreitz/requests/downloads","issues_url":"https://api.github.com/repos/kennethreitz/requests/issues{/number}","pulls_url":"https://api.github.com/repos/kennethreitz/requests/pulls{/number}","milestones_url":"https://api.github.com/repos/kennethreitz/requests/milestones{/number}","notifications_url":"https://api.github.com/repos/kennethreitz/requests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kennethreitz/requests/labels{/name}","releases_url":"https://api.github.com/repos/kennethreitz/requests/releases{/id}","created_at":"2011-02-13T18:38:17Z","updated_at":"2016-01-20T15:18:08Z","pushed_at":"2016-01-20T18:48:58Z","git_url":"git://github.com/kennethreitz/requests.git","ssh_url":"git@github.com:kennethreitz/requests.git","clone_url":"https://github.com/kennethreitz/requests.git","svn_url":"https://github.com/kennethreitz/requests","homepage":"python-requests.org","size":9289,"stargazers_count":17160,"watchers_count":17160,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2990,"mirror_url":null,"open_issues_count":87,"forks":2990,"open_issues":87,"watchers":17160,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/2972"},"html":{"href":"https://github.com/kennethreitz/requests/pull/2972"},"issue":{"href":"https://api.github.com/repos/kennethreitz/requests/issues/2972"},"comments":{"href":"https://api.github.com/repos/kennethreitz/requests/issues/2972/comments"},"review_comments":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/2972/comments"},"review_comment":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/2972/commits"},"statuses":{"href":"https://api.github.com/repos/kennethreitz/requests/statuses/6a8a480d6c535e8fd52526875296576c5309203c"}}}}