[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

Alex Willmer report at bugs.python.org
Tue Jun 11 03:31:54 EDT 2019


Alex Willmer <alex at moreati.org.uk> added the comment:

I don't think I can do this. My WIP code is in https://github.com/moreati/cpython/pull/new/bpo-37210, and associated make test output is attached.

Principal blockers

-  `_pickle.PickleBuffer.raw()` can return a contiguous buffer from either a c_contiguous, or f_contiguous buffer. memoryview() (and hence pickle._PickleBuffer.raw()) requires a c_contiguous buffer.
- I'm unsure how to allow _PickleBuffer -> bytearray conversion

The most common cause of test failures is `TypeError: cannot pickle 'memoryview' object`. I guess Python is seeing a lack of __reduce__(), and failing back to walking the object attributes. Implementing __reduce__() and or __reduce_ex__() might fix this, but seems moot given the other blockers.

----------
Added file: https://bugs.python.org/file48410/bp0-37201_make_test_20190610.txt

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37210>
_______________________________________


More information about the Python-bugs-list mailing list