GitHub PullRequestReviewCommentEvent at 2014-07-15 13:32:13
Repository: scrapy
Actor: kmike
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/scrapy/scrapy/pulls/comments/14933585","id":14933585,"diff_hunk":"@@ -77,7 +81,7 @@ def _body_or_str(obj, unicode=True):\n             return obj.body_as_unicode()\n         else:\n             return obj.body.decode('utf-8')\n-    elif type(obj) is type(u''):\n+    elif type(obj) is six.text_type:","path":"scrapy/utils/iterators.py","position":null,"original_position":35,"commit_id":"1cd9c4d6531f0d0d2b322f193c5c554c615fce68","original_commit_id":"0786e84a33155ebc8d8d3502e3a7f3060b86a4ec","user":{"login":"kmike","id":107893,"avatar_url":"https://avatars.githubusercontent.com/u/107893?","gravatar_id":"3e9dc491607f52141897a765eaab25e4","url":"https://api.github.com/users/kmike","html_url":"https://github.com/kmike","followers_url":"https://api.github.com/users/kmike/followers","following_url":"https://api.github.com/users/kmike/following{/other_user}","gists_url":"https://api.github.com/users/kmike/gists{/gist_id}","starred_url":"https://api.github.com/users/kmike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmike/subscriptions","organizations_url":"https://api.github.com/users/kmike/orgs","repos_url":"https://api.github.com/users/kmike/repos","events_url":"https://api.github.com/users/kmike/events{/privacy}","received_events_url":"https://api.github.com/users/kmike/received_events","type":"User","site_admin":false},"body":"@dangra wrote this code in https://github.com/scrapy/scrapy/commit/3f156ad845e49c7e6684f10cee6ce555364eaa13, maybe he can comment on this.\r\n\r\nYour big stash is going to be one of the trickies parts :) See also: https://github.com/scrapy/scrapy/issues/778","created_at":"2014-07-15T13:32:13Z","updated_at":"2014-07-15T13:32:13Z","html_url":"https://github.com/scrapy/scrapy/pull/803#discussion_r14933585","pull_request_url":"https://api.github.com/repos/scrapy/scrapy/pulls/803","_links":{"self":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/comments/14933585"},"html":{"href":"https://github.com/scrapy/scrapy/pull/803#discussion_r14933585"},"pull_request":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/803"}}},"pull_request":{"url":"https://api.github.com/repos/scrapy/scrapy/pulls/803","id":18393327,"html_url":"https://github.com/scrapy/scrapy/pull/803","diff_url":"https://github.com/scrapy/scrapy/pull/803.diff","patch_url":"https://github.com/scrapy/scrapy/pull/803.patch","issue_url":"https://api.github.com/repos/scrapy/scrapy/issues/803","number":803,"state":"open","title":"PY3: use six.BytesIO and six.moves.cStringIO","user":{"login":"felixonmars","id":1006477,"avatar_url":"https://avatars.githubusercontent.com/u/1006477?","gravatar_id":"48b2061f9e9a00023417bc1174532e81","url":"https://api.github.com/users/felixonmars","html_url":"https://github.com/felixonmars","followers_url":"https://api.github.com/users/felixonmars/followers","following_url":"https://api.github.com/users/felixonmars/following{/other_user}","gists_url":"https://api.github.com/users/felixonmars/gists{/gist_id}","starred_url":"https://api.github.com/users/felixonmars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixonmars/subscriptions","organizations_url":"https://api.github.com/users/felixonmars/orgs","repos_url":"https://api.github.com/users/felixonmars/repos","events_url":"https://api.github.com/users/felixonmars/events{/privacy}","received_events_url":"https://api.github.com/users/felixonmars/received_events","type":"User","site_admin":false},"body":"I've followed some code and found that most of the content are binary, so I use `six.BytesIO` here (there's one exception that I still use StringIO for). I'm not sure if it's the best solution since it means `StringIO.StringIO` but not `cStringIO.StringIO` in Python 2.x, so performance can be affected.\r\n\r\nAn alternative way would be a try-except block to import `cStringIO.StringIO` first, and fallback to `io.BytesIO`.","created_at":"2014-07-15T07:58:55Z","updated_at":"2014-07-15T13:32:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f91b33dc7e062a3a907e1a96d9c622f179155e3e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scrapy/scrapy/pulls/803/commits","review_comments_url":"https://api.github.com/repos/scrapy/scrapy/pulls/803/comments","review_comment_url":"https://api.github.com/repos/scrapy/scrapy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/scrapy/scrapy/issues/803/comments","statuses_url":"https://api.github.com/repos/scrapy/scrapy/statuses/1cd9c4d6531f0d0d2b322f193c5c554c615fce68","head":{"label":"felixonmars:py3-port","ref":"py3-port","sha":"1cd9c4d6531f0d0d2b322f193c5c554c615fce68","user":{"login":"felixonmars","id":1006477,"avatar_url":"https://avatars.githubusercontent.com/u/1006477?","gravatar_id":"48b2061f9e9a00023417bc1174532e81","url":"https://api.github.com/users/felixonmars","html_url":"https://github.com/felixonmars","followers_url":"https://api.github.com/users/felixonmars/followers","following_url":"https://api.github.com/users/felixonmars/following{/other_user}","gists_url":"https://api.github.com/users/felixonmars/gists{/gist_id}","starred_url":"https://api.github.com/users/felixonmars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixonmars/subscriptions","organizations_url":"https://api.github.com/users/felixonmars/orgs","repos_url":"https://api.github.com/users/felixonmars/repos","events_url":"https://api.github.com/users/felixonmars/events{/privacy}","received_events_url":"https://api.github.com/users/felixonmars/received_events","type":"User","site_admin":false},"repo":{"id":21813241,"name":"scrapy","full_name":"felixonmars/scrapy","owner":{"login":"felixonmars","id":1006477,"avatar_url":"https://avatars.githubusercontent.com/u/1006477?","gravatar_id":"48b2061f9e9a00023417bc1174532e81","url":"https://api.github.com/users/felixonmars","html_url":"https://github.com/felixonmars","followers_url":"https://api.github.com/users/felixonmars/followers","following_url":"https://api.github.com/users/felixonmars/following{/other_user}","gists_url":"https://api.github.com/users/felixonmars/gists{/gist_id}","starred_url":"https://api.github.com/users/felixonmars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixonmars/subscriptions","organizations_url":"https://api.github.com/users/felixonmars/orgs","repos_url":"https://api.github.com/users/felixonmars/repos","events_url":"https://api.github.com/users/felixonmars/events{/privacy}","received_events_url":"https://api.github.com/users/felixonmars/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/felixonmars/scrapy","description":"Scrapy, a fast high-level screen scraping and web crawling framework for Python.","fork":true,"url":"https://api.github.com/repos/felixonmars/scrapy","forks_url":"https://api.github.com/repos/felixonmars/scrapy/forks","keys_url":"https://api.github.com/repos/felixonmars/scrapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felixonmars/scrapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felixonmars/scrapy/teams","hooks_url":"https://api.github.com/repos/felixonmars/scrapy/hooks","issue_events_url":"https://api.github.com/repos/felixonmars/scrapy/issues/events{/number}","events_url":"https://api.github.com/repos/felixonmars/scrapy/events","assignees_url":"https://api.github.com/repos/felixonmars/scrapy/assignees{/user}","branches_url":"https://api.github.com/repos/felixonmars/scrapy/branches{/branch}","tags_url":"https://api.github.com/repos/felixonmars/scrapy/tags","blobs_url":"https://api.github.com/repos/felixonmars/scrapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felixonmars/scrapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felixonmars/scrapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/felixonmars/scrapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felixonmars/scrapy/statuses/{sha}","languages_url":"https://api.github.com/repos/felixonmars/scrapy/languages","stargazers_url":"https://api.github.com/repos/felixonmars/scrapy/stargazers","contributors_url":"https://api.github.com/repos/felixonmars/scrapy/contributors","subscribers_url":"https://api.github.com/repos/felixonmars/scrapy/subscribers","subscription_url":"https://api.github.com/repos/felixonmars/scrapy/subscription","commits_url":"https://api.github.com/repos/felixonmars/scrapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/felixonmars/scrapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/felixonmars/scrapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/felixonmars/scrapy/issues/comments/{number}","contents_url":"https://api.github.com/repos/felixonmars/scrapy/contents/{+path}","compare_url":"https://api.github.com/repos/felixonmars/scrapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felixonmars/scrapy/merges","archive_url":"https://api.github.com/repos/felixonmars/scrapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felixonmars/scrapy/downloads","issues_url":"https://api.github.com/repos/felixonmars/scrapy/issues{/number}","pulls_url":"https://api.github.com/repos/felixonmars/scrapy/pulls{/number}","milestones_url":"https://api.github.com/repos/felixonmars/scrapy/milestones{/number}","notifications_url":"https://api.github.com/repos/felixonmars/scrapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felixonmars/scrapy/labels{/name}","releases_url":"https://api.github.com/repos/felixonmars/scrapy/releases{/id}","created_at":"2014-07-14T08:52:32Z","updated_at":"2014-07-14T08:50:51Z","pushed_at":"2014-07-15T13:26:05Z","git_url":"git://github.com/felixonmars/scrapy.git","ssh_url":"git@github.com:felixonmars/scrapy.git","clone_url":"https://github.com/felixonmars/scrapy.git","svn_url":"https://github.com/felixonmars/scrapy","homepage":"http://scrapy.org","size":27851,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":false,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scrapy:master","ref":"master","sha":"91387b6e557223fb0ca9c7065a923c4308689630","user":{"login":"scrapy","id":733635,"avatar_url":"https://avatars.githubusercontent.com/u/733635?","gravatar_id":"4b1f68760dddf81c5cf5da23b592ffe2","url":"https://api.github.com/users/scrapy","html_url":"https://github.com/scrapy","followers_url":"https://api.github.com/users/scrapy/followers","following_url":"https://api.github.com/users/scrapy/following{/other_user}","gists_url":"https://api.github.com/users/scrapy/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapy/subscriptions","organizations_url":"https://api.github.com/users/scrapy/orgs","repos_url":"https://api.github.com/users/scrapy/repos","events_url":"https://api.github.com/users/scrapy/events{/privacy}","received_events_url":"https://api.github.com/users/scrapy/received_events","type":"Organization","site_admin":false},"repo":{"id":529502,"name":"scrapy","full_name":"scrapy/scrapy","owner":{"login":"scrapy","id":733635,"avatar_url":"https://avatars.githubusercontent.com/u/733635?","gravatar_id":"4b1f68760dddf81c5cf5da23b592ffe2","url":"https://api.github.com/users/scrapy","html_url":"https://github.com/scrapy","followers_url":"https://api.github.com/users/scrapy/followers","following_url":"https://api.github.com/users/scrapy/following{/other_user}","gists_url":"https://api.github.com/users/scrapy/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapy/subscriptions","organizations_url":"https://api.github.com/users/scrapy/orgs","repos_url":"https://api.github.com/users/scrapy/repos","events_url":"https://api.github.com/users/scrapy/events{/privacy}","received_events_url":"https://api.github.com/users/scrapy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrapy/scrapy","description":"Scrapy, a fast high-level screen scraping and web crawling framework for Python.","fork":false,"url":"https://api.github.com/repos/scrapy/scrapy","forks_url":"https://api.github.com/repos/scrapy/scrapy/forks","keys_url":"https://api.github.com/repos/scrapy/scrapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrapy/scrapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrapy/scrapy/teams","hooks_url":"https://api.github.com/repos/scrapy/scrapy/hooks","issue_events_url":"https://api.github.com/repos/scrapy/scrapy/issues/events{/number}","events_url":"https://api.github.com/repos/scrapy/scrapy/events","assignees_url":"https://api.github.com/repos/scrapy/scrapy/assignees{/user}","branches_url":"https://api.github.com/repos/scrapy/scrapy/branches{/branch}","tags_url":"https://api.github.com/repos/scrapy/scrapy/tags","blobs_url":"https://api.github.com/repos/scrapy/scrapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrapy/scrapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrapy/scrapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrapy/scrapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrapy/scrapy/statuses/{sha}","languages_url":"https://api.github.com/repos/scrapy/scrapy/languages","stargazers_url":"https://api.github.com/repos/scrapy/scrapy/stargazers","contributors_url":"https://api.github.com/repos/scrapy/scrapy/contributors","subscribers_url":"https://api.github.com/repos/scrapy/scrapy/subscribers","subscription_url":"https://api.github.com/repos/scrapy/scrapy/subscription","commits_url":"https://api.github.com/repos/scrapy/scrapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrapy/scrapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrapy/scrapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrapy/scrapy/issues/comments/{number}","contents_url":"https://api.github.com/repos/scrapy/scrapy/contents/{+path}","compare_url":"https://api.github.com/repos/scrapy/scrapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrapy/scrapy/merges","archive_url":"https://api.github.com/repos/scrapy/scrapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrapy/scrapy/downloads","issues_url":"https://api.github.com/repos/scrapy/scrapy/issues{/number}","pulls_url":"https://api.github.com/repos/scrapy/scrapy/pulls{/number}","milestones_url":"https://api.github.com/repos/scrapy/scrapy/milestones{/number}","notifications_url":"https://api.github.com/repos/scrapy/scrapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrapy/scrapy/labels{/name}","releases_url":"https://api.github.com/repos/scrapy/scrapy/releases{/id}","created_at":"2010-02-22T02:01:14Z","updated_at":"2014-07-15T12:48:35Z","pushed_at":"2014-07-14T15:49:40Z","git_url":"git://github.com/scrapy/scrapy.git","ssh_url":"git@github.com:scrapy/scrapy.git","clone_url":"https://github.com/scrapy/scrapy.git","svn_url":"https://github.com/scrapy/scrapy","homepage":"http://scrapy.org","size":27851,"stargazers_count":5241,"watchers_count":5241,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"forks_count":1420,"mirror_url":null,"open_issues_count":148,"forks":1420,"open_issues":148,"watchers":5241,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/803"},"html":{"href":"https://github.com/scrapy/scrapy/pull/803"},"issue":{"href":"https://api.github.com/repos/scrapy/scrapy/issues/803"},"comments":{"href":"https://api.github.com/repos/scrapy/scrapy/issues/803/comments"},"review_comments":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/803/comments"},"review_comment":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/803/commits"},"statuses":{"href":"https://api.github.com/repos/scrapy/scrapy/statuses/1cd9c4d6531f0d0d2b322f193c5c554c615fce68"}}}}