cloudpipe / cloudpipe/cloudpickle

Cannot pickle attrs classes

Open
#320 7 comments 4 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.9k
Forks
195
Avg merge
1d 10h
Merged PRs (30d)
1

Description

```
from attr import attrs, attrib
import cloudpickle

@attrs
class Foo:
x = attrib()

cloudpickle.dumps(Foo)
```
Fails with `TypeError: cannot pickle 'property' object` for me.
python 3.8.1, attrs = "19.3.0", cloudpickle = "1.2.2"

As mentioned here: https://github.com/python-attrs/attrs/issues/458 there is also some issue with
`TypeError: cannot pickle '_thread._local' object` that can be worked around by using `@attrs(repr=False)`. The repr fix does not help with the above.

See below for a snipet to reproduce the `TypeError: cannot pickle '_thread._local' object`:
```
from attr import attrs
import cloudpickle

@attrs
class Foo:
pass

cloudpickle.dumps(Foo)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.