Skip to content

When trying to load generator with send and some closing state can't set attributes of built-in/extension type 'cloudpickle_generators._core.unset_value_type #6

@merc1031

Description

@merc1031

Notes: Running python3.6 on ubuntu

I am trying to use your project to make this library (https://github.com/JadenGeller/Guac) work on cpython.
In particular i am changing line 40 in this file (https://github.com/JadenGeller/Guac/blob/master/guac/monad.py) to cloudpickle.loads(cloudpickle.dumps(continuation)) after registering cloudpickle_generators at the top of the file.

then i simply copied Guac's make_change example into example.py and tried to run it and i get the following error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/code/guac/monad.py", line 109, in monadic_context
    return monad._run(f(*args, **kwargs))
  File "/code/guac/monad.py", line 56, in _run
    return step(next(computation), computation)
  File "/code/guac/monad.py", line 54, in step
    return self.bind(monadic_value, proceed)
  File "/code/guac/instances.py", line 32, in bind
    result += f(elem)
  File "/code/guac/monad.py", line 49, in proceed
    return step(invocation.send(x), invocation)
  File "/code/guac/monad.py", line 54, in step
    return self.bind(monadic_value, proceed)
  File "/code/guac/instances.py", line 32, in bind
    result += f(elem)
  File "/code/guac/monad.py", line 47, in proceed
    invocation = cloudpickle.loads(d) # Requires Pypy!
  File "/code/src/cloudpickle/cloudpickle/cloudpickle.py", line 1250, in _rehydrate_skeleton_class
    setattr(skeleton_class, attrname, attr)
TypeError: can't set attributes of built-in/extension type 'cloudpickle_generators._core.unset_value_type'

I have an example repo at https://github.com/merc1031/Guac/tree/test_cloudpickle

To repro you should be able to simple pip install -r requirements.txt followed by

python3
>>> import example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions