{"action":"created","comment":{"url":"https://api.github.com/repos/zopefoundation/ZODB/pulls/comments/30706422","id":30706422,"diff_hunk":"@@ -61,14 +72,58 @@ def loads(s):\n     FILESTORAGE_MAGIC = b\"FS30\"\n \n \n-# XXX: consistent spelling of inst_persistent_id/persistent_id?\n-#      e.g. StorageTestBase and probably elsewhere\n+def PersistentPickler(persistent_id, *args, **kwargs):\n+    \"\"\"\n+    Returns a :class:`Pickler` that will use the given ``persistent_id``\n+    to get persistent IDs. The remainder of the arguments are passed to the\n+    Pickler itself.\n+\n+    This covers the differences between Python 2 and 3 and PyPy/zodbpickle.\n+    \"\"\"\n+    p = Pickler(*args, **kwargs)\n+    if sys.version_info[0] < 3:\n+        p.inst_persistent_id = persistent_id\n+        # PyPy uses a python implementation of cPickle in both Python 2\n+        # and Python 3. We can't really detect inst_persistent_id as its\n+        # a magic attribute that's not readable, but it doesn't hurt to\n+        # simply always assign to persistent_id also\n+        p.persistent_id = persistent_id\n+    else:\n+        p.persistent_id = persistent_id","path":"src/ZODB/_compat.py","position":56,"original_position":56,"commit_id":"5d38a086be4bcf20558d8bcec33cd95d065a7082","original_commit_id":"5d38a086be4bcf20558d8bcec33cd95d065a7082","user":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars.githubusercontent.com/u/1256082?v=3","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"body":"Will do. I just moved existing code here from `ZODB.serialize`, but it's code that I originally wrote :)","created_at":"2015-05-20T14:20:32Z","updated_at":"2015-05-20T14:20:32Z","html_url":"https://github.com/zopefoundation/ZODB/pull/34#discussion_r30706422","pull_request_url":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/zopefoundation/ZODB/pulls/comments/30706422"},"html":{"href":"https://github.com/zopefoundation/ZODB/pull/34#discussion_r30706422"},"pull_request":{"href":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34","id":35780673,"html_url":"https://github.com/zopefoundation/ZODB/pull/34","diff_url":"https://github.com/zopefoundation/ZODB/pull/34.diff","patch_url":"https://github.com/zopefoundation/ZODB/pull/34.patch","issue_url":"https://api.github.com/repos/zopefoundation/ZODB/issues/34","number":34,"state":"open","locked":false,"title":"Support PyPy. ","user":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars.githubusercontent.com/u/1256082?v=3","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"body":"Fixes #33. Depends on persistent 4.1.0. Also supports jython, though you have to run the tests manually so that's not mentioned.\r\n\r\nHighlights of changes:\r\n\r\n- Use zodbpickle under not just PyPy but Python2.7. This fixes the broken `noload` problem that's encountered by many of the tools and things like relstorage and zc.zodbdgc.\r\n- Centralize the creation of picklers and unpicklers, smoothing over the differences between Python versions and zodbpickle. This takes care of an existing TODO.\r\n- The Blob class needs to use an external weakref, not one stored on `self`. See https://bitbucket.org/pypy/pypy/issue/2030/circular-weakref-callbacks-never-called\r\n\r\nOther than that, the changes are pretty minor and mostly in doctests.","created_at":"2015-05-19T22:14:22Z","updated_at":"2015-05-20T14:20:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45815ed28c1b45d9f8e2079544569a543782cad6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34/commits","review_comments_url":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34/comments","review_comment_url":"https://api.github.com/repos/zopefoundation/ZODB/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zopefoundation/ZODB/issues/34/comments","statuses_url":"https://api.github.com/repos/zopefoundation/ZODB/statuses/5d38a086be4bcf20558d8bcec33cd95d065a7082","head":{"label":"NextThought:pypy","ref":"pypy","sha":"5d38a086be4bcf20558d8bcec33cd95d065a7082","user":{"login":"NextThought","id":2072248,"avatar_url":"https://avatars.githubusercontent.com/u/2072248?v=3","gravatar_id":"","url":"https://api.github.com/users/NextThought","html_url":"https://github.com/NextThought","followers_url":"https://api.github.com/users/NextThought/followers","following_url":"https://api.github.com/users/NextThought/following{/other_user}","gists_url":"https://api.github.com/users/NextThought/gists{/gist_id}","starred_url":"https://api.github.com/users/NextThought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NextThought/subscriptions","organizations_url":"https://api.github.com/users/NextThought/orgs","repos_url":"https://api.github.com/users/NextThought/repos","events_url":"https://api.github.com/users/NextThought/events{/privacy}","received_events_url":"https://api.github.com/users/NextThought/received_events","type":"Organization","site_admin":false},"repo":{"id":16962967,"name":"ZODB","full_name":"NextThought/ZODB","owner":{"login":"NextThought","id":2072248,"avatar_url":"https://avatars.githubusercontent.com/u/2072248?v=3","gravatar_id":"","url":"https://api.github.com/users/NextThought","html_url":"https://github.com/NextThought","followers_url":"https://api.github.com/users/NextThought/followers","following_url":"https://api.github.com/users/NextThought/following{/other_user}","gists_url":"https://api.github.com/users/NextThought/gists{/gist_id}","starred_url":"https://api.github.com/users/NextThought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NextThought/subscriptions","organizations_url":"https://api.github.com/users/NextThought/orgs","repos_url":"https://api.github.com/users/NextThought/repos","events_url":"https://api.github.com/users/NextThought/events{/privacy}","received_events_url":"https://api.github.com/users/NextThought/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NextThought/ZODB","description":"The ZODB object database","fork":true,"url":"https://api.github.com/repos/NextThought/ZODB","forks_url":"https://api.github.com/repos/NextThought/ZODB/forks","keys_url":"https://api.github.com/repos/NextThought/ZODB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NextThought/ZODB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NextThought/ZODB/teams","hooks_url":"https://api.github.com/repos/NextThought/ZODB/hooks","issue_events_url":"https://api.github.com/repos/NextThought/ZODB/issues/events{/number}","events_url":"https://api.github.com/repos/NextThought/ZODB/events","assignees_url":"https://api.github.com/repos/NextThought/ZODB/assignees{/user}","branches_url":"https://api.github.com/repos/NextThought/ZODB/branches{/branch}","tags_url":"https://api.github.com/repos/NextThought/ZODB/tags","blobs_url":"https://api.github.com/repos/NextThought/ZODB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NextThought/ZODB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NextThought/ZODB/git/refs{/sha}","trees_url":"https://api.github.com/repos/NextThought/ZODB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NextThought/ZODB/statuses/{sha}","languages_url":"https://api.github.com/repos/NextThought/ZODB/languages","stargazers_url":"https://api.github.com/repos/NextThought/ZODB/stargazers","contributors_url":"https://api.github.com/repos/NextThought/ZODB/contributors","subscribers_url":"https://api.github.com/repos/NextThought/ZODB/subscribers","subscription_url":"https://api.github.com/repos/NextThought/ZODB/subscription","commits_url":"https://api.github.com/repos/NextThought/ZODB/commits{/sha}","git_commits_url":"https://api.github.com/repos/NextThought/ZODB/git/commits{/sha}","comments_url":"https://api.github.com/repos/NextThought/ZODB/comments{/number}","issue_comment_url":"https://api.github.com/repos/NextThought/ZODB/issues/comments{/number}","contents_url":"https://api.github.com/repos/NextThought/ZODB/contents/{+path}","compare_url":"https://api.github.com/repos/NextThought/ZODB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NextThought/ZODB/merges","archive_url":"https://api.github.com/repos/NextThought/ZODB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NextThought/ZODB/downloads","issues_url":"https://api.github.com/repos/NextThought/ZODB/issues{/number}","pulls_url":"https://api.github.com/repos/NextThought/ZODB/pulls{/number}","milestones_url":"https://api.github.com/repos/NextThought/ZODB/milestones{/number}","notifications_url":"https://api.github.com/repos/NextThought/ZODB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NextThought/ZODB/labels{/name}","releases_url":"https://api.github.com/repos/NextThought/ZODB/releases{/id}","created_at":"2014-02-18T20:40:34Z","updated_at":"2015-04-07T17:31:21Z","pushed_at":"2015-05-20T11:55:17Z","git_url":"git://github.com/NextThought/ZODB.git","ssh_url":"git@github.com:NextThought/ZODB.git","clone_url":"https://github.com/NextThought/ZODB.git","svn_url":"https://github.com/NextThought/ZODB","homepage":"www.zodb.org","size":24971,"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":"zopefoundation:master","ref":"master","sha":"4bc02fde1cde2bbf2e3ec7a96a720240230e1b76","user":{"login":"zopefoundation","id":1163184,"avatar_url":"https://avatars.githubusercontent.com/u/1163184?v=3","gravatar_id":"","url":"https://api.github.com/users/zopefoundation","html_url":"https://github.com/zopefoundation","followers_url":"https://api.github.com/users/zopefoundation/followers","following_url":"https://api.github.com/users/zopefoundation/following{/other_user}","gists_url":"https://api.github.com/users/zopefoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/zopefoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopefoundation/subscriptions","organizations_url":"https://api.github.com/users/zopefoundation/orgs","repos_url":"https://api.github.com/users/zopefoundation/repos","events_url":"https://api.github.com/users/zopefoundation/events{/privacy}","received_events_url":"https://api.github.com/users/zopefoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":7357595,"name":"ZODB","full_name":"zopefoundation/ZODB","owner":{"login":"zopefoundation","id":1163184,"avatar_url":"https://avatars.githubusercontent.com/u/1163184?v=3","gravatar_id":"","url":"https://api.github.com/users/zopefoundation","html_url":"https://github.com/zopefoundation","followers_url":"https://api.github.com/users/zopefoundation/followers","following_url":"https://api.github.com/users/zopefoundation/following{/other_user}","gists_url":"https://api.github.com/users/zopefoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/zopefoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopefoundation/subscriptions","organizations_url":"https://api.github.com/users/zopefoundation/orgs","repos_url":"https://api.github.com/users/zopefoundation/repos","events_url":"https://api.github.com/users/zopefoundation/events{/privacy}","received_events_url":"https://api.github.com/users/zopefoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zopefoundation/ZODB","description":"The ZODB object database","fork":false,"url":"https://api.github.com/repos/zopefoundation/ZODB","forks_url":"https://api.github.com/repos/zopefoundation/ZODB/forks","keys_url":"https://api.github.com/repos/zopefoundation/ZODB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zopefoundation/ZODB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zopefoundation/ZODB/teams","hooks_url":"https://api.github.com/repos/zopefoundation/ZODB/hooks","issue_events_url":"https://api.github.com/repos/zopefoundation/ZODB/issues/events{/number}","events_url":"https://api.github.com/repos/zopefoundation/ZODB/events","assignees_url":"https://api.github.com/repos/zopefoundation/ZODB/assignees{/user}","branches_url":"https://api.github.com/repos/zopefoundation/ZODB/branches{/branch}","tags_url":"https://api.github.com/repos/zopefoundation/ZODB/tags","blobs_url":"https://api.github.com/repos/zopefoundation/ZODB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zopefoundation/ZODB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zopefoundation/ZODB/git/refs{/sha}","trees_url":"https://api.github.com/repos/zopefoundation/ZODB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zopefoundation/ZODB/statuses/{sha}","languages_url":"https://api.github.com/repos/zopefoundation/ZODB/languages","stargazers_url":"https://api.github.com/repos/zopefoundation/ZODB/stargazers","contributors_url":"https://api.github.com/repos/zopefoundation/ZODB/contributors","subscribers_url":"https://api.github.com/repos/zopefoundation/ZODB/subscribers","subscription_url":"https://api.github.com/repos/zopefoundation/ZODB/subscription","commits_url":"https://api.github.com/repos/zopefoundation/ZODB/commits{/sha}","git_commits_url":"https://api.github.com/repos/zopefoundation/ZODB/git/commits{/sha}","comments_url":"https://api.github.com/repos/zopefoundation/ZODB/comments{/number}","issue_comment_url":"https://api.github.com/repos/zopefoundation/ZODB/issues/comments{/number}","contents_url":"https://api.github.com/repos/zopefoundation/ZODB/contents/{+path}","compare_url":"https://api.github.com/repos/zopefoundation/ZODB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zopefoundation/ZODB/merges","archive_url":"https://api.github.com/repos/zopefoundation/ZODB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zopefoundation/ZODB/downloads","issues_url":"https://api.github.com/repos/zopefoundation/ZODB/issues{/number}","pulls_url":"https://api.github.com/repos/zopefoundation/ZODB/pulls{/number}","milestones_url":"https://api.github.com/repos/zopefoundation/ZODB/milestones{/number}","notifications_url":"https://api.github.com/repos/zopefoundation/ZODB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zopefoundation/ZODB/labels{/name}","releases_url":"https://api.github.com/repos/zopefoundation/ZODB/releases{/id}","created_at":"2012-12-28T17:47:39Z","updated_at":"2015-04-24T16:43:01Z","pushed_at":"2015-05-20T11:55:18Z","git_url":"git://github.com/zopefoundation/ZODB.git","ssh_url":"git@github.com:zopefoundation/ZODB.git","clone_url":"https://github.com/zopefoundation/ZODB.git","svn_url":"https://github.com/zopefoundation/ZODB","homepage":"www.zodb.org","size":27683,"stargazers_count":59,"watchers_count":59,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":11,"forks":15,"open_issues":11,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34"},"html":{"href":"https://github.com/zopefoundation/ZODB/pull/34"},"issue":{"href":"https://api.github.com/repos/zopefoundation/ZODB/issues/34"},"comments":{"href":"https://api.github.com/repos/zopefoundation/ZODB/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/zopefoundation/ZODB/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zopefoundation/ZODB/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/zopefoundation/ZODB/statuses/5d38a086be4bcf20558d8bcec33cd95d065a7082"}}}}