cloudpipe / cloudpipe/cloudpickle

CloudPickle returns IndexError when trying to pickle _UnPicklable object

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

Description

The error happens at https://github.com/cloudpipe/cloudpickle/blob/a76f0812ccdbbd1397f36d536dc4d57b6d0557d6/cloudpickle/cloudpickle_fast.py#L634.

When I try to pickle the below class, it is failing with `NotImplementedError` then it calls the exception, since `NotImplemented` error is a subclass of `RuntimeError`, the above code fails during `except` since `e.args` is empty.

```
with io.BytesIO() as file:
pickler = cloudpickle.CloudPickler(file)
pickler.dump(_Unpicklable(1))

class _Unpicklable(object):
def __init__(self, value):
self.value = value

def __eq__(self, other):
return self.value == other.value

def __getstate__(self):
raise NotImplementedError()

def __setstate__(self, state):
raise NotImplementedError()
```

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.