{"action":"closed","number":121,"pull_request":{"url":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/121","id":47895276,"html_url":"https://github.com/splunk/splunk-sdk-python/pull/121","diff_url":"https://github.com/splunk/splunk-sdk-python/pull/121.diff","patch_url":"https://github.com/splunk/splunk-sdk-python/pull/121.patch","issue_url":"https://api.github.com/repos/splunk/splunk-sdk-python/issues/121","number":121,"state":"closed","locked":false,"title":"Make splunklin.binding.ResponseReader.readline function.","user":{"login":"cjw296","id":632049,"avatar_url":"https://avatars.githubusercontent.com/u/632049?v=3","gravatar_id":"","url":"https://api.github.com/users/cjw296","html_url":"https://github.com/cjw296","followers_url":"https://api.github.com/users/cjw296/followers","following_url":"https://api.github.com/users/cjw296/following{/other_user}","gists_url":"https://api.github.com/users/cjw296/gists{/gist_id}","starred_url":"https://api.github.com/users/cjw296/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjw296/subscriptions","organizations_url":"https://api.github.com/users/cjw296/orgs","repos_url":"https://api.github.com/users/cjw296/repos","events_url":"https://api.github.com/users/cjw296/events{/privacy}","received_events_url":"https://api.github.com/users/cjw296/received_events","type":"User","site_admin":false},"body":"I bumped into this trying to do:\r\n\r\n```\r\n>>> conn = client.connect(...)\r\n>>> result = conn.jobs.export('search ...', output_mode='csv')\r\n>>> result.readline()\r\n'\"'\r\n```\r\n\r\nThe problem is the 1 byte peek followed by a one byte read here:\r\n\r\nhttps://hg.python.org/cpython/file/v2.7.5/Modules/_io/iobase.c#l466\r\n\r\nThis results in an attempt to read 0 bytes from the HTTPResponse in result._response, which ends up hitting this code path:\r\n\r\nhttps://hg.python.org/cpython/file/v2.7.5/Lib/httplib.py#l567\r\n\r\nWe ask for 0 bytes, and sure enough, we get 0 bytes, but httplib sees this as \"no data left\" and closes the connection.\r\n\r\nI couldn't figure out how best to test this, or indeed, how to run the test suite in such a way that the existing tests on HEAD of master all passed before I started work. But, functional testing has shown this to work.\r\n","created_at":"2015-10-16T10:40:52Z","updated_at":"2015-11-22T21:48:01Z","closed_at":"2015-11-22T21:48:01Z","merged_at":null,"merge_commit_sha":"c61e1d2c8ff5adbbc6b7c898b995766c0b7b6772","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/121/commits","review_comments_url":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/121/comments","review_comment_url":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/splunk/splunk-sdk-python/issues/121/comments","statuses_url":"https://api.github.com/repos/splunk/splunk-sdk-python/statuses/b2d3292e574a249871f70752c8d12d42b1a11309","head":{"label":"cjw296:readline_bug","ref":"readline_bug","sha":"b2d3292e574a249871f70752c8d12d42b1a11309","user":{"login":"cjw296","id":632049,"avatar_url":"https://avatars.githubusercontent.com/u/632049?v=3","gravatar_id":"","url":"https://api.github.com/users/cjw296","html_url":"https://github.com/cjw296","followers_url":"https://api.github.com/users/cjw296/followers","following_url":"https://api.github.com/users/cjw296/following{/other_user}","gists_url":"https://api.github.com/users/cjw296/gists{/gist_id}","starred_url":"https://api.github.com/users/cjw296/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjw296/subscriptions","organizations_url":"https://api.github.com/users/cjw296/orgs","repos_url":"https://api.github.com/users/cjw296/repos","events_url":"https://api.github.com/users/cjw296/events{/privacy}","received_events_url":"https://api.github.com/users/cjw296/received_events","type":"User","site_admin":false},"repo":{"id":44376187,"name":"splunk-sdk-python","full_name":"cjw296/splunk-sdk-python","owner":{"login":"cjw296","id":632049,"avatar_url":"https://avatars.githubusercontent.com/u/632049?v=3","gravatar_id":"","url":"https://api.github.com/users/cjw296","html_url":"https://github.com/cjw296","followers_url":"https://api.github.com/users/cjw296/followers","following_url":"https://api.github.com/users/cjw296/following{/other_user}","gists_url":"https://api.github.com/users/cjw296/gists{/gist_id}","starred_url":"https://api.github.com/users/cjw296/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjw296/subscriptions","organizations_url":"https://api.github.com/users/cjw296/orgs","repos_url":"https://api.github.com/users/cjw296/repos","events_url":"https://api.github.com/users/cjw296/events{/privacy}","received_events_url":"https://api.github.com/users/cjw296/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cjw296/splunk-sdk-python","description":"Splunk Software Development Kit for Python","fork":true,"url":"https://api.github.com/repos/cjw296/splunk-sdk-python","forks_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/forks","keys_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/teams","hooks_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/hooks","issue_events_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/issues/events{/number}","events_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/events","assignees_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/assignees{/user}","branches_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/branches{/branch}","tags_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/tags","blobs_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/statuses/{sha}","languages_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/languages","stargazers_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/stargazers","contributors_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/contributors","subscribers_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/subscribers","subscription_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/subscription","commits_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/contents/{+path}","compare_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/merges","archive_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/downloads","issues_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/issues{/number}","pulls_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/pulls{/number}","milestones_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/milestones{/number}","notifications_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/labels{/name}","releases_url":"https://api.github.com/repos/cjw296/splunk-sdk-python/releases{/id}","created_at":"2015-10-16T09:40:51Z","updated_at":"2015-10-16T09:40:55Z","pushed_at":"2015-10-16T10:33:26Z","git_url":"git://github.com/cjw296/splunk-sdk-python.git","ssh_url":"git@github.com:cjw296/splunk-sdk-python.git","clone_url":"https://github.com/cjw296/splunk-sdk-python.git","svn_url":"https://github.com/cjw296/splunk-sdk-python","homepage":"http://dev.splunk.com","size":69905,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"splunk:master","ref":"master","sha":"3a7df39e51b253342e910b6dd18bddd20856d0a1","user":{"login":"splunk","id":651467,"avatar_url":"https://avatars.githubusercontent.com/u/651467?v=3","gravatar_id":"","url":"https://api.github.com/users/splunk","html_url":"https://github.com/splunk","followers_url":"https://api.github.com/users/splunk/followers","following_url":"https://api.github.com/users/splunk/following{/other_user}","gists_url":"https://api.github.com/users/splunk/gists{/gist_id}","starred_url":"https://api.github.com/users/splunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splunk/subscriptions","organizations_url":"https://api.github.com/users/splunk/orgs","repos_url":"https://api.github.com/users/splunk/repos","events_url":"https://api.github.com/users/splunk/events{/privacy}","received_events_url":"https://api.github.com/users/splunk/received_events","type":"Organization","site_admin":false},"repo":{"id":1504670,"name":"splunk-sdk-python","full_name":"splunk/splunk-sdk-python","owner":{"login":"splunk","id":651467,"avatar_url":"https://avatars.githubusercontent.com/u/651467?v=3","gravatar_id":"","url":"https://api.github.com/users/splunk","html_url":"https://github.com/splunk","followers_url":"https://api.github.com/users/splunk/followers","following_url":"https://api.github.com/users/splunk/following{/other_user}","gists_url":"https://api.github.com/users/splunk/gists{/gist_id}","starred_url":"https://api.github.com/users/splunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splunk/subscriptions","organizations_url":"https://api.github.com/users/splunk/orgs","repos_url":"https://api.github.com/users/splunk/repos","events_url":"https://api.github.com/users/splunk/events{/privacy}","received_events_url":"https://api.github.com/users/splunk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/splunk/splunk-sdk-python","description":"Splunk Software Development Kit for Python","fork":false,"url":"https://api.github.com/repos/splunk/splunk-sdk-python","forks_url":"https://api.github.com/repos/splunk/splunk-sdk-python/forks","keys_url":"https://api.github.com/repos/splunk/splunk-sdk-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/splunk/splunk-sdk-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/splunk/splunk-sdk-python/teams","hooks_url":"https://api.github.com/repos/splunk/splunk-sdk-python/hooks","issue_events_url":"https://api.github.com/repos/splunk/splunk-sdk-python/issues/events{/number}","events_url":"https://api.github.com/repos/splunk/splunk-sdk-python/events","assignees_url":"https://api.github.com/repos/splunk/splunk-sdk-python/assignees{/user}","branches_url":"https://api.github.com/repos/splunk/splunk-sdk-python/branches{/branch}","tags_url":"https://api.github.com/repos/splunk/splunk-sdk-python/tags","blobs_url":"https://api.github.com/repos/splunk/splunk-sdk-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/splunk/splunk-sdk-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/splunk/splunk-sdk-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/splunk/splunk-sdk-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/splunk/splunk-sdk-python/statuses/{sha}","languages_url":"https://api.github.com/repos/splunk/splunk-sdk-python/languages","stargazers_url":"https://api.github.com/repos/splunk/splunk-sdk-python/stargazers","contributors_url":"https://api.github.com/repos/splunk/splunk-sdk-python/contributors","subscribers_url":"https://api.github.com/repos/splunk/splunk-sdk-python/subscribers","subscription_url":"https://api.github.com/repos/splunk/splunk-sdk-python/subscription","commits_url":"https://api.github.com/repos/splunk/splunk-sdk-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/splunk/splunk-sdk-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/splunk/splunk-sdk-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/splunk/splunk-sdk-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/splunk/splunk-sdk-python/contents/{+path}","compare_url":"https://api.github.com/repos/splunk/splunk-sdk-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/splunk/splunk-sdk-python/merges","archive_url":"https://api.github.com/repos/splunk/splunk-sdk-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/splunk/splunk-sdk-python/downloads","issues_url":"https://api.github.com/repos/splunk/splunk-sdk-python/issues{/number}","pulls_url":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls{/number}","milestones_url":"https://api.github.com/repos/splunk/splunk-sdk-python/milestones{/number}","notifications_url":"https://api.github.com/repos/splunk/splunk-sdk-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/splunk/splunk-sdk-python/labels{/name}","releases_url":"https://api.github.com/repos/splunk/splunk-sdk-python/releases{/id}","created_at":"2011-03-20T23:20:06Z","updated_at":"2015-11-15T04:28:00Z","pushed_at":"2015-11-21T02:40:30Z","git_url":"git://github.com/splunk/splunk-sdk-python.git","ssh_url":"git@github.com:splunk/splunk-sdk-python.git","clone_url":"https://github.com/splunk/splunk-sdk-python.git","svn_url":"https://github.com/splunk/splunk-sdk-python","homepage":"http://dev.splunk.com","size":69935,"stargazers_count":171,"watchers_count":171,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":9,"forks":67,"open_issues":9,"watchers":171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/121"},"html":{"href":"https://github.com/splunk/splunk-sdk-python/pull/121"},"issue":{"href":"https://api.github.com/repos/splunk/splunk-sdk-python/issues/121"},"comments":{"href":"https://api.github.com/repos/splunk/splunk-sdk-python/issues/121/comments"},"review_comments":{"href":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/121/comments"},"review_comment":{"href":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/splunk/splunk-sdk-python/pulls/121/commits"},"statuses":{"href":"https://api.github.com/repos/splunk/splunk-sdk-python/statuses/b2d3292e574a249871f70752c8d12d42b1a11309"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":2,"review_comments":0,"commits":1,"additions":2,"deletions":1,"changed_files":1}}