Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudPickle returns IndexError when trying to pickle _UnPicklable object #504

Open
AnandInguva opened this issue Apr 4, 2023 · 0 comments

Comments

@AnandInguva
Copy link

AnandInguva commented Apr 4, 2023

The error happens at

if "recursion" in e.args[0]:
.

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant