pickle-compat · PyPI
https://pypi.org/project/pickle-compat28.12.2020 · pip install pickle-compat. Then monkey-patch your pickle library with this: import pickle_compat pickle_compat.patch() From this point you can safely assume that what's pickled with pickle.dumps () in Python 2 can be converted back to the real object in Python 3 with pickle.loads (), and vise versa.
pickle5 · PyPI
https://pypi.org/project/pickle520.11.2021 · It should work with Python 3.5, 3.6 and 3.7. Basic usage is similar to the pickle module, except that the module to be imported is pickle5: import pickle5 as pickle pb = pickle.PickleBuffer(b"foo") data = pickle.dumps(pb, protocol=5) assert pickle.loads(data) == b"foo". Detailed documentation can be found in PEP 574 and the standard pickle ...
pickle5 · PyPI
pypi.org › project › pickle5Nov 20, 2021 · It should work with Python 3.5, 3.6 and 3.7. Basic usage is similar to the pickle module, except that the module to be imported is pickle5: import pickle5 as pickle pb = pickle.PickleBuffer(b"foo") data = pickle.dumps(pb, protocol=5) assert pickle.loads(data) == b"foo". Detailed documentation can be found in PEP 574 and the standard pickle ...