{"action":"created","comment":{"url":"https://api.github.com/repos/shazow/urllib3/pulls/comments/28978202","id":28978202,"diff_hunk":"@@ -284,9 +299,10 @@ def stream(self, amt=2**16, decode_content=None):\n             If True, will attempt to decode the body based on the\n             'content-encoding' header.\n         \"\"\"\n+        self._init_decoder()\n         if self.chunked:\n             for line in self.read_chunked(amt):\n-                yield line\n+                yield self._decode(line, decode_content, True)","path":"urllib3/response.py","position":78,"original_position":78,"commit_id":"466e5a53be04688899e3376ff136ae49eefa43fc","original_commit_id":"466e5a53be04688899e3376ff136ae49eefa43fc","user":{"login":"shazow","id":6292,"avatar_url":"https://avatars.githubusercontent.com/u/6292?v=3","gravatar_id":"","url":"https://api.github.com/users/shazow","html_url":"https://github.com/shazow","followers_url":"https://api.github.com/users/shazow/followers","following_url":"https://api.github.com/users/shazow/following{/other_user}","gists_url":"https://api.github.com/users/shazow/gists{/gist_id}","starred_url":"https://api.github.com/users/shazow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazow/subscriptions","organizations_url":"https://api.github.com/users/shazow/orgs","repos_url":"https://api.github.com/users/shazow/repos","events_url":"https://api.github.com/users/shazow/events{/privacy}","received_events_url":"https://api.github.com/users/shazow/received_events","type":"User","site_admin":false},"body":"In the future, it'd be nice to supply a named var or param for magic values like True.","created_at":"2015-04-23T16:20:42Z","updated_at":"2015-04-23T16:20:42Z","html_url":"https://github.com/shazow/urllib3/pull/595#discussion_r28978202","pull_request_url":"https://api.github.com/repos/shazow/urllib3/pulls/595","_links":{"self":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/comments/28978202"},"html":{"href":"https://github.com/shazow/urllib3/pull/595#discussion_r28978202"},"pull_request":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/595"}}},"pull_request":{"url":"https://api.github.com/repos/shazow/urllib3/pulls/595","id":33958150,"html_url":"https://github.com/shazow/urllib3/pull/595","diff_url":"https://github.com/shazow/urllib3/pull/595.diff","patch_url":"https://github.com/shazow/urllib3/pull/595.patch","issue_url":"https://api.github.com/repos/shazow/urllib3/issues/595","number":595,"state":"open","locked":false,"title":"Decode information received from read_chunked in stream","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":"Previously, when we read chunked data we always decoded it because it\r\nwas handled by the read method on the HTTPResponse. Now that it's a\r\nseparate method, we need to handle it. This is a quick fix for #593 to\r\naddress a regression in behaviour.\r\n\r\nFixes #593 \r\n\r\n---\r\n\r\nI confirmed this worked by linking my working copy of urllib3 into requests and testing against the site in the original issue on requests, e.g., by doing\r\n\r\n```py\r\nimport requests\r\nr = requests.get('https://liquidstate.atlassian.net/rest/api/2/serverInfo')\r\nr.json()\r\n```\r\n\r\nI simply didn't have time to write a test case. Also IMO a better solution would be to make `read_chunked` handle this instead of `stream` but this was the fastest hotfix I could produce. I'm adding both @shazow and @Lukasa to my fork so they can dev on this if they want from the same branch","created_at":"2015-04-23T14:03:54Z","updated_at":"2015-04-23T16:20:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"016808b7490fbe9a6d4e5e61a7bc45f454e2fe3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shazow/urllib3/pulls/595/commits","review_comments_url":"https://api.github.com/repos/shazow/urllib3/pulls/595/comments","review_comment_url":"https://api.github.com/repos/shazow/urllib3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shazow/urllib3/issues/595/comments","statuses_url":"https://api.github.com/repos/shazow/urllib3/statuses/466e5a53be04688899e3376ff136ae49eefa43fc","head":{"label":"sigmavirus24:bug/593","ref":"bug/593","sha":"466e5a53be04688899e3376ff136ae49eefa43fc","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},"repo":{"id":14912894,"name":"urllib3","full_name":"sigmavirus24/urllib3","owner":{"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},"private":false,"html_url":"https://github.com/sigmavirus24/urllib3","description":"Python HTTP library with thread-safe connection pooling, file post support, sanity friendly, and more.","fork":true,"url":"https://api.github.com/repos/sigmavirus24/urllib3","forks_url":"https://api.github.com/repos/sigmavirus24/urllib3/forks","keys_url":"https://api.github.com/repos/sigmavirus24/urllib3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sigmavirus24/urllib3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sigmavirus24/urllib3/teams","hooks_url":"https://api.github.com/repos/sigmavirus24/urllib3/hooks","issue_events_url":"https://api.github.com/repos/sigmavirus24/urllib3/issues/events{/number}","events_url":"https://api.github.com/repos/sigmavirus24/urllib3/events","assignees_url":"https://api.github.com/repos/sigmavirus24/urllib3/assignees{/user}","branches_url":"https://api.github.com/repos/sigmavirus24/urllib3/branches{/branch}","tags_url":"https://api.github.com/repos/sigmavirus24/urllib3/tags","blobs_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/refs{/sha}","trees_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sigmavirus24/urllib3/statuses/{sha}","languages_url":"https://api.github.com/repos/sigmavirus24/urllib3/languages","stargazers_url":"https://api.github.com/repos/sigmavirus24/urllib3/stargazers","contributors_url":"https://api.github.com/repos/sigmavirus24/urllib3/contributors","subscribers_url":"https://api.github.com/repos/sigmavirus24/urllib3/subscribers","subscription_url":"https://api.github.com/repos/sigmavirus24/urllib3/subscription","commits_url":"https://api.github.com/repos/sigmavirus24/urllib3/commits{/sha}","git_commits_url":"https://api.github.com/repos/sigmavirus24/urllib3/git/commits{/sha}","comments_url":"https://api.github.com/repos/sigmavirus24/urllib3/comments{/number}","issue_comment_url":"https://api.github.com/repos/sigmavirus24/urllib3/issues/comments{/number}","contents_url":"https://api.github.com/repos/sigmavirus24/urllib3/contents/{+path}","compare_url":"https://api.github.com/repos/sigmavirus24/urllib3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sigmavirus24/urllib3/merges","archive_url":"https://api.github.com/repos/sigmavirus24/urllib3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sigmavirus24/urllib3/downloads","issues_url":"https://api.github.com/repos/sigmavirus24/urllib3/issues{/number}","pulls_url":"https://api.github.com/repos/sigmavirus24/urllib3/pulls{/number}","milestones_url":"https://api.github.com/repos/sigmavirus24/urllib3/milestones{/number}","notifications_url":"https://api.github.com/repos/sigmavirus24/urllib3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sigmavirus24/urllib3/labels{/name}","releases_url":"https://api.github.com/repos/sigmavirus24/urllib3/releases{/id}","created_at":"2013-12-04T03:04:13Z","updated_at":"2015-04-23T13:47:12Z","pushed_at":"2015-04-23T15:31:36Z","git_url":"git://github.com/sigmavirus24/urllib3.git","ssh_url":"git@github.com:sigmavirus24/urllib3.git","clone_url":"https://github.com/sigmavirus24/urllib3.git","svn_url":"https://github.com/sigmavirus24/urllib3","homepage":"http://urllib3.readthedocs.org/","size":2369,"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":"shazow:master","ref":"master","sha":"10b7a0fefa6596f47a9a6afc80f1f4d1ae950b66","user":{"login":"shazow","id":6292,"avatar_url":"https://avatars.githubusercontent.com/u/6292?v=3","gravatar_id":"","url":"https://api.github.com/users/shazow","html_url":"https://github.com/shazow","followers_url":"https://api.github.com/users/shazow/followers","following_url":"https://api.github.com/users/shazow/following{/other_user}","gists_url":"https://api.github.com/users/shazow/gists{/gist_id}","starred_url":"https://api.github.com/users/shazow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazow/subscriptions","organizations_url":"https://api.github.com/users/shazow/orgs","repos_url":"https://api.github.com/users/shazow/repos","events_url":"https://api.github.com/users/shazow/events{/privacy}","received_events_url":"https://api.github.com/users/shazow/received_events","type":"User","site_admin":false},"repo":{"id":2410676,"name":"urllib3","full_name":"shazow/urllib3","owner":{"login":"shazow","id":6292,"avatar_url":"https://avatars.githubusercontent.com/u/6292?v=3","gravatar_id":"","url":"https://api.github.com/users/shazow","html_url":"https://github.com/shazow","followers_url":"https://api.github.com/users/shazow/followers","following_url":"https://api.github.com/users/shazow/following{/other_user}","gists_url":"https://api.github.com/users/shazow/gists{/gist_id}","starred_url":"https://api.github.com/users/shazow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazow/subscriptions","organizations_url":"https://api.github.com/users/shazow/orgs","repos_url":"https://api.github.com/users/shazow/repos","events_url":"https://api.github.com/users/shazow/events{/privacy}","received_events_url":"https://api.github.com/users/shazow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shazow/urllib3","description":"Python HTTP library with thread-safe connection pooling, file post support, sanity friendly, and more.","fork":false,"url":"https://api.github.com/repos/shazow/urllib3","forks_url":"https://api.github.com/repos/shazow/urllib3/forks","keys_url":"https://api.github.com/repos/shazow/urllib3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shazow/urllib3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shazow/urllib3/teams","hooks_url":"https://api.github.com/repos/shazow/urllib3/hooks","issue_events_url":"https://api.github.com/repos/shazow/urllib3/issues/events{/number}","events_url":"https://api.github.com/repos/shazow/urllib3/events","assignees_url":"https://api.github.com/repos/shazow/urllib3/assignees{/user}","branches_url":"https://api.github.com/repos/shazow/urllib3/branches{/branch}","tags_url":"https://api.github.com/repos/shazow/urllib3/tags","blobs_url":"https://api.github.com/repos/shazow/urllib3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shazow/urllib3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shazow/urllib3/git/refs{/sha}","trees_url":"https://api.github.com/repos/shazow/urllib3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shazow/urllib3/statuses/{sha}","languages_url":"https://api.github.com/repos/shazow/urllib3/languages","stargazers_url":"https://api.github.com/repos/shazow/urllib3/stargazers","contributors_url":"https://api.github.com/repos/shazow/urllib3/contributors","subscribers_url":"https://api.github.com/repos/shazow/urllib3/subscribers","subscription_url":"https://api.github.com/repos/shazow/urllib3/subscription","commits_url":"https://api.github.com/repos/shazow/urllib3/commits{/sha}","git_commits_url":"https://api.github.com/repos/shazow/urllib3/git/commits{/sha}","comments_url":"https://api.github.com/repos/shazow/urllib3/comments{/number}","issue_comment_url":"https://api.github.com/repos/shazow/urllib3/issues/comments{/number}","contents_url":"https://api.github.com/repos/shazow/urllib3/contents/{+path}","compare_url":"https://api.github.com/repos/shazow/urllib3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shazow/urllib3/merges","archive_url":"https://api.github.com/repos/shazow/urllib3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shazow/urllib3/downloads","issues_url":"https://api.github.com/repos/shazow/urllib3/issues{/number}","pulls_url":"https://api.github.com/repos/shazow/urllib3/pulls{/number}","milestones_url":"https://api.github.com/repos/shazow/urllib3/milestones{/number}","notifications_url":"https://api.github.com/repos/shazow/urllib3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shazow/urllib3/labels{/name}","releases_url":"https://api.github.com/repos/shazow/urllib3/releases{/id}","created_at":"2011-09-18T18:08:28Z","updated_at":"2015-04-23T05:48:50Z","pushed_at":"2015-04-23T15:31:37Z","git_url":"git://github.com/shazow/urllib3.git","ssh_url":"git@github.com:shazow/urllib3.git","clone_url":"https://github.com/shazow/urllib3.git","svn_url":"https://github.com/shazow/urllib3","homepage":"http://urllib3.readthedocs.org/","size":5543,"stargazers_count":817,"watchers_count":817,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":243,"mirror_url":null,"open_issues_count":67,"forks":243,"open_issues":67,"watchers":817,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/595"},"html":{"href":"https://github.com/shazow/urllib3/pull/595"},"issue":{"href":"https://api.github.com/repos/shazow/urllib3/issues/595"},"comments":{"href":"https://api.github.com/repos/shazow/urllib3/issues/595/comments"},"review_comments":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/595/comments"},"review_comment":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shazow/urllib3/pulls/595/commits"},"statuses":{"href":"https://api.github.com/repos/shazow/urllib3/statuses/466e5a53be04688899e3376ff136ae49eefa43fc"}}}}