{"action":"created","comment":{"url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/comments/52411810","id":52411810,"diff_hunk":"@@ -453,14 +447,34 @@ def _parse_domain_from_url(self, spider, url):\n     def _select_source(self, target, sources):\n         return sources.keys()[0]\n \n-    # Placeholder for now\n     def _recompute_deltas(self, new_source, old_source, target_set):\n-        #   For each key in the target set:\n-        #       - read the delta _data and _length from the db\n-        #       - decode the response with the old source\n-        #       - encode the response with the new source\n-        #       - write the new _data, _time, and _length to db\n-        print('Chopper Dave says uh-oh, shouldn\\'t hit this yet!\\n')\n+        for target_key in target_set:\n+            # Get old response from the db\n+            data = self._read_data(key_to_use=target_key, ignore_time=True)\n+            # Decode serialized delta response with old source\n+            old_serial_response = self._decode_response(data, old_source)\n+            # Deserialze the \n+            data = self._deserialize(old_serial_response)\n+            # Reconstruct original response","path":"scrapy/extensions/httpcache.py","position":null,"original_position":93,"commit_id":"f1cfd8e47cde95ad54c88d85feaee50dc05e2d6d","original_commit_id":"c1e9ed5a17708b805fd1e73cea57411900981440","user":{"login":"ericalmadovapsu","id":13228768,"avatar_url":"https://avatars.githubusercontent.com/u/13228768?v=3","gravatar_id":"","url":"https://api.github.com/users/ericalmadovapsu","html_url":"https://github.com/ericalmadovapsu","followers_url":"https://api.github.com/users/ericalmadovapsu/followers","following_url":"https://api.github.com/users/ericalmadovapsu/following{/other_user}","gists_url":"https://api.github.com/users/ericalmadovapsu/gists{/gist_id}","starred_url":"https://api.github.com/users/ericalmadovapsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericalmadovapsu/subscriptions","organizations_url":"https://api.github.com/users/ericalmadovapsu/orgs","repos_url":"https://api.github.com/users/ericalmadovapsu/repos","events_url":"https://api.github.com/users/ericalmadovapsu/events{/privacy}","received_events_url":"https://api.github.com/users/ericalmadovapsu/received_events","type":"User","site_admin":false},"body":"encode response cannot perform on an object, it will only accept a read only buffer or a string. This is why i was reconstructing the response object and then serializing it. ","created_at":"2016-02-10T03:48:30Z","updated_at":"2016-02-10T03:48:30Z","html_url":"https://github.com/PDX-Capstone-Team-C/scrapy/pull/47#discussion_r52411810","pull_request_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/comments/52411810"},"html":{"href":"https://github.com/PDX-Capstone-Team-C/scrapy/pull/47#discussion_r52411810"},"pull_request":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47","id":58711554,"html_url":"https://github.com/PDX-Capstone-Team-C/scrapy/pull/47","diff_url":"https://github.com/PDX-Capstone-Team-C/scrapy/pull/47.diff","patch_url":"https://github.com/PDX-Capstone-Team-C/scrapy/pull/47.patch","issue_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/issues/47","number":47,"state":"open","locked":false,"title":"Topic/recompute deltas","user":{"login":"ericalmadovapsu","id":13228768,"avatar_url":"https://avatars.githubusercontent.com/u/13228768?v=3","gravatar_id":"","url":"https://api.github.com/users/ericalmadovapsu","html_url":"https://github.com/ericalmadovapsu","followers_url":"https://api.github.com/users/ericalmadovapsu/followers","following_url":"https://api.github.com/users/ericalmadovapsu/following{/other_user}","gists_url":"https://api.github.com/users/ericalmadovapsu/gists{/gist_id}","starred_url":"https://api.github.com/users/ericalmadovapsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericalmadovapsu/subscriptions","organizations_url":"https://api.github.com/users/ericalmadovapsu/orgs","repos_url":"https://api.github.com/users/ericalmadovapsu/repos","events_url":"https://api.github.com/users/ericalmadovapsu/events{/privacy}","received_events_url":"https://api.github.com/users/ericalmadovapsu/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-09T07:01:04Z","updated_at":"2016-02-10T03:48:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9772c2d5d9ba6d1ba63848b881dcd4d72402abc2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47/commits","review_comments_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47/comments","review_comment_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/issues/47/comments","statuses_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/statuses/f1cfd8e47cde95ad54c88d85feaee50dc05e2d6d","head":{"label":"ericalmadovapsu:topic/recompute-deltas","ref":"topic/recompute-deltas","sha":"f1cfd8e47cde95ad54c88d85feaee50dc05e2d6d","user":{"login":"ericalmadovapsu","id":13228768,"avatar_url":"https://avatars.githubusercontent.com/u/13228768?v=3","gravatar_id":"","url":"https://api.github.com/users/ericalmadovapsu","html_url":"https://github.com/ericalmadovapsu","followers_url":"https://api.github.com/users/ericalmadovapsu/followers","following_url":"https://api.github.com/users/ericalmadovapsu/following{/other_user}","gists_url":"https://api.github.com/users/ericalmadovapsu/gists{/gist_id}","starred_url":"https://api.github.com/users/ericalmadovapsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericalmadovapsu/subscriptions","organizations_url":"https://api.github.com/users/ericalmadovapsu/orgs","repos_url":"https://api.github.com/users/ericalmadovapsu/repos","events_url":"https://api.github.com/users/ericalmadovapsu/events{/privacy}","received_events_url":"https://api.github.com/users/ericalmadovapsu/received_events","type":"User","site_admin":false},"repo":{"id":46457274,"name":"scrapy","full_name":"ericalmadovapsu/scrapy","owner":{"login":"ericalmadovapsu","id":13228768,"avatar_url":"https://avatars.githubusercontent.com/u/13228768?v=3","gravatar_id":"","url":"https://api.github.com/users/ericalmadovapsu","html_url":"https://github.com/ericalmadovapsu","followers_url":"https://api.github.com/users/ericalmadovapsu/followers","following_url":"https://api.github.com/users/ericalmadovapsu/following{/other_user}","gists_url":"https://api.github.com/users/ericalmadovapsu/gists{/gist_id}","starred_url":"https://api.github.com/users/ericalmadovapsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericalmadovapsu/subscriptions","organizations_url":"https://api.github.com/users/ericalmadovapsu/orgs","repos_url":"https://api.github.com/users/ericalmadovapsu/repos","events_url":"https://api.github.com/users/ericalmadovapsu/events{/privacy}","received_events_url":"https://api.github.com/users/ericalmadovapsu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericalmadovapsu/scrapy","description":"Scrapy, a fast high-level web crawling & scraping framework for Python.","fork":true,"url":"https://api.github.com/repos/ericalmadovapsu/scrapy","forks_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/forks","keys_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/teams","hooks_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/hooks","issue_events_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/issues/events{/number}","events_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/events","assignees_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/assignees{/user}","branches_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/branches{/branch}","tags_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/tags","blobs_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/statuses/{sha}","languages_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/languages","stargazers_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/stargazers","contributors_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/contributors","subscribers_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/subscribers","subscription_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/subscription","commits_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/contents/{+path}","compare_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/merges","archive_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/downloads","issues_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/issues{/number}","pulls_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/pulls{/number}","milestones_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/milestones{/number}","notifications_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/labels{/name}","releases_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/releases{/id}","deployments_url":"https://api.github.com/repos/ericalmadovapsu/scrapy/deployments","created_at":"2015-11-19T00:46:47Z","updated_at":"2016-01-23T23:58:19Z","pushed_at":"2016-02-10T02:28:30Z","git_url":"git://github.com/ericalmadovapsu/scrapy.git","ssh_url":"git@github.com:ericalmadovapsu/scrapy.git","clone_url":"https://github.com/ericalmadovapsu/scrapy.git","svn_url":"https://github.com/ericalmadovapsu/scrapy","homepage":"http://scrapy.org","size":14070,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"PDX-Capstone-Team-C:develop","ref":"develop","sha":"9ba1197bfd9fde362400ecc66e77b19f12a9af2c","user":{"login":"PDX-Capstone-Team-C","id":15136661,"avatar_url":"https://avatars.githubusercontent.com/u/15136661?v=3","gravatar_id":"","url":"https://api.github.com/users/PDX-Capstone-Team-C","html_url":"https://github.com/PDX-Capstone-Team-C","followers_url":"https://api.github.com/users/PDX-Capstone-Team-C/followers","following_url":"https://api.github.com/users/PDX-Capstone-Team-C/following{/other_user}","gists_url":"https://api.github.com/users/PDX-Capstone-Team-C/gists{/gist_id}","starred_url":"https://api.github.com/users/PDX-Capstone-Team-C/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PDX-Capstone-Team-C/subscriptions","organizations_url":"https://api.github.com/users/PDX-Capstone-Team-C/orgs","repos_url":"https://api.github.com/users/PDX-Capstone-Team-C/repos","events_url":"https://api.github.com/users/PDX-Capstone-Team-C/events{/privacy}","received_events_url":"https://api.github.com/users/PDX-Capstone-Team-C/received_events","type":"Organization","site_admin":false},"repo":{"id":46314633,"name":"scrapy","full_name":"PDX-Capstone-Team-C/scrapy","owner":{"login":"PDX-Capstone-Team-C","id":15136661,"avatar_url":"https://avatars.githubusercontent.com/u/15136661?v=3","gravatar_id":"","url":"https://api.github.com/users/PDX-Capstone-Team-C","html_url":"https://github.com/PDX-Capstone-Team-C","followers_url":"https://api.github.com/users/PDX-Capstone-Team-C/followers","following_url":"https://api.github.com/users/PDX-Capstone-Team-C/following{/other_user}","gists_url":"https://api.github.com/users/PDX-Capstone-Team-C/gists{/gist_id}","starred_url":"https://api.github.com/users/PDX-Capstone-Team-C/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PDX-Capstone-Team-C/subscriptions","organizations_url":"https://api.github.com/users/PDX-Capstone-Team-C/orgs","repos_url":"https://api.github.com/users/PDX-Capstone-Team-C/repos","events_url":"https://api.github.com/users/PDX-Capstone-Team-C/events{/privacy}","received_events_url":"https://api.github.com/users/PDX-Capstone-Team-C/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PDX-Capstone-Team-C/scrapy","description":"Scrapy, a fast high-level web crawling & scraping framework for Python.","fork":true,"url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy","forks_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/forks","keys_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/teams","hooks_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/hooks","issue_events_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/issues/events{/number}","events_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/events","assignees_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/assignees{/user}","branches_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/branches{/branch}","tags_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/tags","blobs_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/statuses/{sha}","languages_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/languages","stargazers_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/stargazers","contributors_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/contributors","subscribers_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/subscribers","subscription_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/subscription","commits_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/contents/{+path}","compare_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/merges","archive_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/downloads","issues_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/issues{/number}","pulls_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls{/number}","milestones_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/milestones{/number}","notifications_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/labels{/name}","releases_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/releases{/id}","deployments_url":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/deployments","created_at":"2015-11-17T01:21:38Z","updated_at":"2016-01-23T22:26:53Z","pushed_at":"2016-02-10T02:28:32Z","git_url":"git://github.com/PDX-Capstone-Team-C/scrapy.git","ssh_url":"git@github.com:PDX-Capstone-Team-C/scrapy.git","clone_url":"https://github.com/PDX-Capstone-Team-C/scrapy.git","svn_url":"https://github.com/PDX-Capstone-Team-C/scrapy","homepage":"http://scrapy.org","size":14041,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":18,"forks":5,"open_issues":18,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47"},"html":{"href":"https://github.com/PDX-Capstone-Team-C/scrapy/pull/47"},"issue":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/issues/47"},"comments":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/PDX-Capstone-Team-C/scrapy/statuses/f1cfd8e47cde95ad54c88d85feaee50dc05e2d6d"}}}}