Skip to content

pickle function call uses kwargs added in python 3.8 #3843

Description

@samaust

A pickle function call uses a kwargs added in python 3.8 (https://github.com/dask/distributed/blob/master/distributed/protocol/pickle.py#L64).

The setyp.py file only requires python >=3.6 (https://github.com/dask/distributed/blob/master/setup.py#L29)

Python version 3.7.4
dask version 2.17.2
distributed version 2.17.0

Error returned

    return pickle.loads(x, buffers=buffers)
TypeError: 'buffers' is an invalid keyword argument for loads()

The function call is
return pickle.loads(x, buffers=buffers)

Python 3.8.3
https://docs.python.org/3/library/pickle.html#pickle.loads

Changed in version 3.8: The buffers argument was added.

Python 3.7.7
https://docs.python.org/3.7/library/pickle.html#pickle.loads

Does not have kwargs buffers

EDIT :
Here is some more information. It looks like the package pickle5 provides a backport for python 3.5, 3.6 and 3.7.

https://docs.python.org/3/library/pickle.html#pickle-oob
https://www.python.org/dev/peps/pep-0574/
https://www.python.org/dev/peps/pep-0574/#pickle5-pypi
https://pypi.org/project/pickle5/

I tried again using python 3.8.3. This time I get another error at the same line

  File "c:\project\env38\lib\site-packages\distributed\protocol\pickle.py", line 64, in loads
    return pickle.loads(x, buffers=buffers)
_pickle.UnpicklingError: pickle data was truncated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions