cloudpipe / cloudpipe/cloudpickle
Serialize/deserialize inconsistent for certain types in 0.4.0
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 195
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 1
Description
In 0.4.0 I can serialize a type, but not deserialize it:
```python
In [1]: import cloudpickle
In [2]: import threading
In [3]: lock = threading.Lock()
In [4]: b = cloudpickle.dumps(type(lock))
In [5]: cloudpickle.loads(b)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
----> 1 cloudpickle.loads(b)
AttributeError: type object 'lock' has no attribute 'acquire_lock'
In [6]: b
Out[6]: b'\x80\x02ccloudpickle.cloudpickle\n_rehydrate_skeleton_class\nq\x00(ccloudpickle.cloudpickle\n_builtin_type\nq\x01X\t\x00\x00\x00ClassTypeq\x02\x85q\x03Rq\x04X\x04\x00\x00\x00lockq\x05c__builtin__\nobject\nq\x06\x85q\x07}q\x08X\x07\x00\x00\x00__doc__q\tNs\x87q\nRq\x0b}q\x0c(X\x08\x00\x00\x00__repr__q\rc__builtin__\ngetattr\nq\x0eh\x0bh\r\x86q\x0fRq\x10X\x0c\x00\x00\x00acquire_lockq\x11h\x0eh\x0bh\x11\x86q\x12Rq\x13X\x07\x00\x00\x00acquireq\x14h\x0eh\x0bh\x14\x86q\x15Rq\x16X\x0c\x00\x00\x00release_lockq\x17h\x0eh\x0bh\x17\x86q\x18Rq\x19X\x07\x00\x00\x00releaseq\x1ah\x0eh\x0bh\x1a\x86q\x1bRq\x1cX\x0b\x00\x00\x00locked_lockq\x1dh\x0eh\x0bh\x1d\x86q\x1eRq\x1fX\x06\x00\x00\x00lockedq h\x0eh\x0bh \x86q!Rq"X\t\x00\x00\x00__enter__q#h\x0eh\x0bh#\x86q$Rq%X\x08\x00\x00\x00__exit__q&h\x0eh\x0bh&\x86q\'Rq(utR.'
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.