{"action":"created","issue":{"url":"https://api.github.com/repos/hynek/attrs/issues/79","repository_url":"https://api.github.com/repos/hynek/attrs","labels_url":"https://api.github.com/repos/hynek/attrs/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/hynek/attrs/issues/79/comments","events_url":"https://api.github.com/repos/hynek/attrs/issues/79/events","html_url":"https://github.com/hynek/attrs/issues/79","id":175547220,"number":79,"title":"FrozenInstanceError with pickle in Spark","user":{"login":"mathieulongtin","id":617359,"avatar_url":"https://avatars.githubusercontent.com/u/617359?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieulongtin","html_url":"https://github.com/mathieulongtin","followers_url":"https://api.github.com/users/mathieulongtin/followers","following_url":"https://api.github.com/users/mathieulongtin/following{/other_user}","gists_url":"https://api.github.com/users/mathieulongtin/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieulongtin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieulongtin/subscriptions","organizations_url":"https://api.github.com/users/mathieulongtin/orgs","repos_url":"https://api.github.com/users/mathieulongtin/repos","events_url":"https://api.github.com/users/mathieulongtin/events{/privacy}","received_events_url":"https://api.github.com/users/mathieulongtin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-07T16:23:18Z","updated_at":"2016-09-07T16:51:10Z","closed_at":null,"body":"Using Apache Spark, with attr 16.1.0, I get this error.\r\n\r\n```\r\nCaused by: org.apache.spark.api.python.PythonException: Traceback (most recent call last):\r\n  File \".../spark/python/pyspark/worker.py\", line 98, in main\r\n    command = pickleSer._read_with_length(infile)\r\n  File \".../spark/python/pyspark/serializers.py\", line 164, in _read_with_length\r\n    return self.loads(obj)\r\n  File \".../spark/python/pyspark/serializers.py\", line 422, in loads\r\n    return pickle.loads(obj)\r\n  File \".../lib/python2.7/site-packages/attr/_make.py\", line 617, in __setattr__\r\n    raise FrozenInstanceError()\r\nFrozenInstanceError\r\n```\r\n\r\nUnfortunately, I can't reproduce it with simple code, for some reason. Using IPython, I managed to track it down to rebuilding `Attributes` class:\r\n```\r\n  /usr/lib64/python2.7/pickle.py(1247)load_build()\r\n   1245         if slotstate:\r\n   1246             for k, v in slotstate.items():\r\n-> 1247                 setattr(inst, k, v)\r\n```\r\n\r\nSpark uses a custom pickler in order to support local function and classes, but still uses the standard unpickler.\r\n\r\nThis was not an issue with 16.0.0, so sticking to that for now."},"comment":{"url":"https://api.github.com/repos/hynek/attrs/issues/comments/245345338","html_url":"https://github.com/hynek/attrs/issues/79#issuecomment-245345338","issue_url":"https://api.github.com/repos/hynek/attrs/issues/79","id":245345338,"user":{"login":"hynek","id":41240,"avatar_url":"https://avatars.githubusercontent.com/u/41240?v=3","gravatar_id":"","url":"https://api.github.com/users/hynek","html_url":"https://github.com/hynek","followers_url":"https://api.github.com/users/hynek/followers","following_url":"https://api.github.com/users/hynek/following{/other_user}","gists_url":"https://api.github.com/users/hynek/gists{/gist_id}","starred_url":"https://api.github.com/users/hynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hynek/subscriptions","organizations_url":"https://api.github.com/users/hynek/orgs","repos_url":"https://api.github.com/users/hynek/repos","events_url":"https://api.github.com/users/hynek/events{/privacy}","received_events_url":"https://api.github.com/users/hynek/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T16:51:10Z","updated_at":"2016-09-07T16:51:10Z","body":"Well because 16.0 didn't have frozen classes? :) Pickle seems to use `setattr` therefore you can't use it with frozen classes. "}}
{"actor":{"display_login":"hynek"}}