{"action":"created","issue":{"url":"https://api.github.com/repos/zopefoundation/zope.security/issues/11","labels_url":"https://api.github.com/repos/zopefoundation/zope.security/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/zopefoundation/zope.security/issues/11/comments","events_url":"https://api.github.com/repos/zopefoundation/zope.security/issues/11/events","html_url":"https://github.com/zopefoundation/zope.security/pull/11","id":81547059,"number":11,"title":"Compatibility with zope.proxy 4.1.5 under 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},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-27T17:37:43Z","updated_at":"2015-06-02T17:29:59Z","closed_at":"2015-06-01T17:54:43Z","pull_request":{"url":"https://api.github.com/repos/zopefoundation/zope.security/pulls/11","html_url":"https://github.com/zopefoundation/zope.security/pull/11","diff_url":"https://github.com/zopefoundation/zope.security/pull/11.diff","patch_url":"https://github.com/zopefoundation/zope.security/pull/11.patch"},"body":"`zope.proxy` 4.1.5 made the pure-Python implementation match the C implementation with respect to handling descriptors/attributes of subclasses. It also explicitly prohibited pickling proxy instances, like the C implementation.\r\n\r\nThe C proxy found in `zope.security`, however, did not implement these behaviours. It allowed any proxy to be pickled and ignored descriptors in subclasses. Yet the Python implementation found here uses the Python code in `zope.proxy` as a base, resulting in breaking the following test.\r\n\r\n```\r\n======================================================================\r\nERROR: test_that_pickling_CheckerPublic_retains_identity (zope.security.tests.test_checker.TestCheckerPublic)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/zope.security/src/zope/security/tests/test_checker.py\", line 1863, in test_that_pickling_CheckerPublic_retains_identity\r\n    self.assertTrue(_pickle.loads(_pickle.dumps(CheckerPublic))\r\n  File \"//pypy/lib_pypy/cPickle.py\", line 124, in dumps\r\n    Pickler(file, protocol).dump(obj)\r\n  File \"//pypy/lib-python/2.7/pickle.py\", line 224, in dump\r\n    self.save(obj)\r\n  File \"//pypy/lib-python/2.7/pickle.py\", line 317, in save\r\n    self.save_global(obj, rv)\r\n  File \"//pypy/lib-python/2.7/pickle.py\", line 792, in save_global\r\n    (obj, module, name))\r\nPicklingError: Can't pickle Global(CheckerPublic,zope.security.checker): it's not found as zope.security.proxy.CheckerPublic\r\n```\r\n\r\nThis PR changes just enough to fix that test by special-casing the three attribute names involved in the Python implementation.\r\n\r\nAlthough no more tests fail, there are now probably other behaviour differences between the C and Python implementations. But mostly things that didn't work with the C implementation and subclasses should now work with the Python implementation, and it seems unlikely to me that that will be a compatibility issue (subclasses of this proxy implementation probably being rare?). "},"comment":{"url":"https://api.github.com/repos/zopefoundation/zope.security/issues/comments/108024253","html_url":"https://github.com/zopefoundation/zope.security/pull/11#issuecomment-108024253","issue_url":"https://api.github.com/repos/zopefoundation/zope.security/issues/11","id":108024253,"user":{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T17:29:59Z","updated_at":"2015-06-02T17:29:59Z","body":"OIC.  I'm guessing that those workarounds are needful, since Travis is breaking."}}