{"action":"opened","number":47,"pull_request":{"url":"https://api.github.com/repos/zopefoundation/BTrees/pulls/47","id":91352319,"html_url":"https://github.com/zopefoundation/BTrees/pull/47","diff_url":"https://github.com/zopefoundation/BTrees/pull/47.diff","patch_url":"https://github.com/zopefoundation/BTrees/pull/47.patch","issue_url":"https://api.github.com/repos/zopefoundation/BTrees/issues/47","number":47,"state":"open","locked":false,"title":"BTreePy: Reset ._data unconditionally in .clear()","user":{"login":"navytux","id":1794248,"avatar_url":"https://avatars.githubusercontent.com/u/1794248?v=3","gravatar_id":"","url":"https://api.github.com/users/navytux","html_url":"https://github.com/navytux","followers_url":"https://api.github.com/users/navytux/followers","following_url":"https://api.github.com/users/navytux/following{/other_user}","gists_url":"https://api.github.com/users/navytux/gists{/gist_id}","starred_url":"https://api.github.com/users/navytux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navytux/subscriptions","organizations_url":"https://api.github.com/users/navytux/orgs","repos_url":"https://api.github.com/users/navytux/repos","events_url":"https://api.github.com/users/navytux/events{/privacy}","received_events_url":"https://api.github.com/users/navytux/received_events","type":"User","site_admin":false},"body":"_Tree.clear() is called by _Tree.__setstate__() to reset both .data and\r\n._firstbucket before actually proceeding with setting internal state\r\nwith data loaded from database.\r\n\r\nHowever since 0718a45e (Use a Python __reduce__ method to make pickles\r\nmatch C.) ._data reset became conditional, first checking that ._data is\r\nnot already empty.\r\n\r\nThe .__setstate__() is often called with object being a ghost.  However\r\nZODB was never promising to keep attributes alive on ghost objects and\r\nin fact attributes kept in __dict__ was always released, but attributes\r\nin slotted variables, probably due to overlook, started to be released\r\non ghostification only recently:\r\n\r\n    https://github.com/zopefoundation/persistent/commit/fe2219f4\r\n    https://github.com/zopefoundation/persistent/pull/44\r\n\r\nand that change causes many BTree tests to fail in pure-python part, e.g.:\r\n\r\n    ERROR: testGhostUnghost (BTrees.tests.test_IIBTree.IIBTreeTest)\r\n    ----------------------------------------------------------------------\r\n    Traceback (most recent call last):\r\n      File \"BTrees/tests/common.py\", line 122, in testGhostUnghost\r\n        self.assertEqual(list(root2[i].items()) , list(t.items()))\r\n      File \"/home/kirr/src/wendelin/z/persistent/persistent/persistence.py\", line 266, in __getattribute__\r\n        oga(self, '_p_activate')()\r\n      File \"/home/kirr/src/wendelin/z/persistent/persistent/persistence.py\", line 386, in _p_activate\r\n        jar.setstate(self)\r\n      File \"/home/kirr/src/wendelin/z/ZODB/src/ZODB/Connection.py\", line 771, in setstate\r\n        self._reader.setGhostState(obj, p)\r\n      File \"/home/kirr/src/wendelin/z/ZODB/src/ZODB/serialize.py\", line 623, in setGhostState\r\n        obj.__setstate__(state)\r\n      File \"BTrees/_base.py\", line 1069, in __setstate__\r\n        self.clear()\r\n      File \"BTrees/_base.py\", line 818, in clear\r\n        if self._data:\r\n      File \"/home/kirr/src/wendelin/z/persistent/persistent/persistence.py\", line 268, in __getattribute__\r\n        return oga(self, name)\r\n    AttributeError: _data\r\n\r\nVia unconditionally resetting ._data in clear we can make the problem go away.\r\n\r\nAfter this patch with PURE_PYTHON=1 BTree testsuite is passing fully again.\r\n\r\n/cc @jamadden ","created_at":"2016-10-28T09:47:59Z","updated_at":"2016-10-28T09:47:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zopefoundation/BTrees/pulls/47/commits","review_comments_url":"https://api.github.com/repos/zopefoundation/BTrees/pulls/47/comments","review_comment_url":"https://api.github.com/repos/zopefoundation/BTrees/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zopefoundation/BTrees/issues/47/comments","statuses_url":"https://api.github.com/repos/zopefoundation/BTrees/statuses/a643eb372c7aa88d97bfab9426dd9ea1106d14f3","head":{"label":"navytux:py-data-reset-fix","ref":"py-data-reset-fix","sha":"a643eb372c7aa88d97bfab9426dd9ea1106d14f3","user":{"login":"navytux","id":1794248,"avatar_url":"https://avatars.githubusercontent.com/u/1794248?v=3","gravatar_id":"","url":"https://api.github.com/users/navytux","html_url":"https://github.com/navytux","followers_url":"https://api.github.com/users/navytux/followers","following_url":"https://api.github.com/users/navytux/following{/other_user}","gists_url":"https://api.github.com/users/navytux/gists{/gist_id}","starred_url":"https://api.github.com/users/navytux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navytux/subscriptions","organizations_url":"https://api.github.com/users/navytux/orgs","repos_url":"https://api.github.com/users/navytux/repos","events_url":"https://api.github.com/users/navytux/events{/privacy}","received_events_url":"https://api.github.com/users/navytux/received_events","type":"User","site_admin":false},"repo":{"id":72194863,"name":"BTrees","full_name":"navytux/BTrees","owner":{"login":"navytux","id":1794248,"avatar_url":"https://avatars.githubusercontent.com/u/1794248?v=3","gravatar_id":"","url":"https://api.github.com/users/navytux","html_url":"https://github.com/navytux","followers_url":"https://api.github.com/users/navytux/followers","following_url":"https://api.github.com/users/navytux/following{/other_user}","gists_url":"https://api.github.com/users/navytux/gists{/gist_id}","starred_url":"https://api.github.com/users/navytux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navytux/subscriptions","organizations_url":"https://api.github.com/users/navytux/orgs","repos_url":"https://api.github.com/users/navytux/repos","events_url":"https://api.github.com/users/navytux/events{/privacy}","received_events_url":"https://api.github.com/users/navytux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/navytux/BTrees","description":null,"fork":true,"url":"https://api.github.com/repos/navytux/BTrees","forks_url":"https://api.github.com/repos/navytux/BTrees/forks","keys_url":"https://api.github.com/repos/navytux/BTrees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/navytux/BTrees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/navytux/BTrees/teams","hooks_url":"https://api.github.com/repos/navytux/BTrees/hooks","issue_events_url":"https://api.github.com/repos/navytux/BTrees/issues/events{/number}","events_url":"https://api.github.com/repos/navytux/BTrees/events","assignees_url":"https://api.github.com/repos/navytux/BTrees/assignees{/user}","branches_url":"https://api.github.com/repos/navytux/BTrees/branches{/branch}","tags_url":"https://api.github.com/repos/navytux/BTrees/tags","blobs_url":"https://api.github.com/repos/navytux/BTrees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/navytux/BTrees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/navytux/BTrees/git/refs{/sha}","trees_url":"https://api.github.com/repos/navytux/BTrees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/navytux/BTrees/statuses/{sha}","languages_url":"https://api.github.com/repos/navytux/BTrees/languages","stargazers_url":"https://api.github.com/repos/navytux/BTrees/stargazers","contributors_url":"https://api.github.com/repos/navytux/BTrees/contributors","subscribers_url":"https://api.github.com/repos/navytux/BTrees/subscribers","subscription_url":"https://api.github.com/repos/navytux/BTrees/subscription","commits_url":"https://api.github.com/repos/navytux/BTrees/commits{/sha}","git_commits_url":"https://api.github.com/repos/navytux/BTrees/git/commits{/sha}","comments_url":"https://api.github.com/repos/navytux/BTrees/comments{/number}","issue_comment_url":"https://api.github.com/repos/navytux/BTrees/issues/comments{/number}","contents_url":"https://api.github.com/repos/navytux/BTrees/contents/{+path}","compare_url":"https://api.github.com/repos/navytux/BTrees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/navytux/BTrees/merges","archive_url":"https://api.github.com/repos/navytux/BTrees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/navytux/BTrees/downloads","issues_url":"https://api.github.com/repos/navytux/BTrees/issues{/number}","pulls_url":"https://api.github.com/repos/navytux/BTrees/pulls{/number}","milestones_url":"https://api.github.com/repos/navytux/BTrees/milestones{/number}","notifications_url":"https://api.github.com/repos/navytux/BTrees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/navytux/BTrees/labels{/name}","releases_url":"https://api.github.com/repos/navytux/BTrees/releases{/id}","deployments_url":"https://api.github.com/repos/navytux/BTrees/deployments","created_at":"2016-10-28T09:40:59Z","updated_at":"2016-10-28T09:41:01Z","pushed_at":"2016-10-28T09:47:18Z","git_url":"git://github.com/navytux/BTrees.git","ssh_url":"git@github.com:navytux/BTrees.git","clone_url":"https://github.com/navytux/BTrees.git","svn_url":"https://github.com/navytux/BTrees","homepage":null,"size":715,"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":"33ab3d3ea8448df8e16c5563dd2f41ea04e78266","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":7444957,"name":"BTrees","full_name":"zopefoundation/BTrees","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/BTrees","description":null,"fork":false,"url":"https://api.github.com/repos/zopefoundation/BTrees","forks_url":"https://api.github.com/repos/zopefoundation/BTrees/forks","keys_url":"https://api.github.com/repos/zopefoundation/BTrees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zopefoundation/BTrees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zopefoundation/BTrees/teams","hooks_url":"https://api.github.com/repos/zopefoundation/BTrees/hooks","issue_events_url":"https://api.github.com/repos/zopefoundation/BTrees/issues/events{/number}","events_url":"https://api.github.com/repos/zopefoundation/BTrees/events","assignees_url":"https://api.github.com/repos/zopefoundation/BTrees/assignees{/user}","branches_url":"https://api.github.com/repos/zopefoundation/BTrees/branches{/branch}","tags_url":"https://api.github.com/repos/zopefoundation/BTrees/tags","blobs_url":"https://api.github.com/repos/zopefoundation/BTrees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zopefoundation/BTrees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zopefoundation/BTrees/git/refs{/sha}","trees_url":"https://api.github.com/repos/zopefoundation/BTrees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zopefoundation/BTrees/statuses/{sha}","languages_url":"https://api.github.com/repos/zopefoundation/BTrees/languages","stargazers_url":"https://api.github.com/repos/zopefoundation/BTrees/stargazers","contributors_url":"https://api.github.com/repos/zopefoundation/BTrees/contributors","subscribers_url":"https://api.github.com/repos/zopefoundation/BTrees/subscribers","subscription_url":"https://api.github.com/repos/zopefoundation/BTrees/subscription","commits_url":"https://api.github.com/repos/zopefoundation/BTrees/commits{/sha}","git_commits_url":"https://api.github.com/repos/zopefoundation/BTrees/git/commits{/sha}","comments_url":"https://api.github.com/repos/zopefoundation/BTrees/comments{/number}","issue_comment_url":"https://api.github.com/repos/zopefoundation/BTrees/issues/comments{/number}","contents_url":"https://api.github.com/repos/zopefoundation/BTrees/contents/{+path}","compare_url":"https://api.github.com/repos/zopefoundation/BTrees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zopefoundation/BTrees/merges","archive_url":"https://api.github.com/repos/zopefoundation/BTrees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zopefoundation/BTrees/downloads","issues_url":"https://api.github.com/repos/zopefoundation/BTrees/issues{/number}","pulls_url":"https://api.github.com/repos/zopefoundation/BTrees/pulls{/number}","milestones_url":"https://api.github.com/repos/zopefoundation/BTrees/milestones{/number}","notifications_url":"https://api.github.com/repos/zopefoundation/BTrees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zopefoundation/BTrees/labels{/name}","releases_url":"https://api.github.com/repos/zopefoundation/BTrees/releases{/id}","deployments_url":"https://api.github.com/repos/zopefoundation/BTrees/deployments","created_at":"2013-01-04T18:15:54Z","updated_at":"2016-10-26T18:26:12Z","pushed_at":"2016-09-29T15:44:35Z","git_url":"git://github.com/zopefoundation/BTrees.git","ssh_url":"git@github.com:zopefoundation/BTrees.git","clone_url":"https://github.com/zopefoundation/BTrees.git","svn_url":"https://github.com/zopefoundation/BTrees","homepage":null,"size":715,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":5,"forks":7,"open_issues":5,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zopefoundation/BTrees/pulls/47"},"html":{"href":"https://github.com/zopefoundation/BTrees/pull/47"},"issue":{"href":"https://api.github.com/repos/zopefoundation/BTrees/issues/47"},"comments":{"href":"https://api.github.com/repos/zopefoundation/BTrees/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/zopefoundation/BTrees/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/zopefoundation/BTrees/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zopefoundation/BTrees/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/zopefoundation/BTrees/statuses/a643eb372c7aa88d97bfab9426dd9ea1106d14f3"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":3,"changed_files":1}}
{"actor":{"display_login":"navytux"}}