Skip to content

cloudpickle 1.5.0 breaks on python 3.6+7 without pickle5 #401

@yannikschaelte

Description

@yannikschaelte

cloudpickle >=1.5.0 fails to dump a complex object using python 3.6+7. Works with 1.4.1. After installing pickle5, it works (related to #370 ?). All works just fine on python 3.8.

Unfortunately, I currently cannot create a minimum test case, as I am not sure what the problem is (tests in an own project fail here https://github.com/ICB-DCM/pyABC/runs/1463556418?check_suite_focus=true, in particular pytest test/base/test_samplers.py). For simple things with local variables etc. I could not reproduce the error. Any hints are welcome, but for the moment installing pickle5 or downgrading to 1.4.0 (or upgrading to python 3.8 ;)) solves the problem for me.

Error message:

pyabc/sampler/multicore_evaluation_parallel.py:104: in sample_until_n_accepted
    simulate_one = pickle.dumps(simulate_one)
../anaconda3/envs/python37/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py:102: in dumps
    cp.dump(obj)
../anaconda3/envs/python37/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py:563: in dump
    return Pickler.dump(self, obj)
../anaconda3/envs/python37/lib/python3.7/pickle.py:437: in dump
    self.save(obj)
../anaconda3/envs/python37/lib/python3.7/pickle.py:504: in save
    f(self, obj) # Call unbound method with explicit self
../anaconda3/envs/python37/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py:745: in save_function
    *self._dynamic_function_reduce(obj), obj=obj
../anaconda3/envs/python37/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py:682: in _save_reduce_pickle5
    dictitems=dictitems, obj=obj
../anaconda3/envs/python37/lib/python3.7/pickle.py:638: in save_reduce
    save(args)
../anaconda3/envs/python37/lib/python3.7/pickle.py:504: in save
    f(self, obj) # Call unbound method with explicit self
../anaconda3/envs/python37/lib/python3.7/pickle.py:789: in save_tuple
    save(element)
../anaconda3/envs/python37/lib/python3.7/pickle.py:504: in save
    f(self, obj) # Call unbound method with explicit self
../anaconda3/envs/python37/lib/python3.7/pickle.py:789: in save_tuple
    save(element)
../anaconda3/envs/python37/lib/python3.7/pickle.py:504: in save
    f(self, obj) # Call unbound method with explicit self
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pickler = <cloudpickle.cloudpickle_fast.CloudPickler object at 0x7f96ee0095d0>
obj = <cell at 0x7f96ee009510: empty>

    @register(CellType)
    def save_cell(pickler, obj):
        log.info("Ce: %s" % obj)
>       f = obj.cell_contents
E       ValueError: Cell is empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions