-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pickle dumps not readable between python 2/3 #22
Comments
What are we using pickles for? |
python data pickles. For example if we store python objects. |
Right yeah, but what is datreant using pickle for? |
datreant.data/src/datreant/data/pydata.py Line 41 in 89f8937
Sure you are on the right repository? |
Ah right yeah, I was looking at core |
Oh well with string handling this is even more broken -.-. We have to check reading/writing with the bytes flags |
This is to say. I now also encountered that a python2 dump cannot be read by python 3 |
https://bugs.python.org/issue6784 So they claim this is resolved. But I honestly haven't found a good solution today to enable reading / writing of pickles between python versions that works problem free. Some simple stiff and builtin types might work but not complex objects. |
The problem is that we always write using the highest available protocol. But I was unaware that python3 introduced a new protocol version
https://stackoverflow.com/questions/25843698/valueerror-unsupported-pickle-protocol-3-python2-pickle-can-not-load-the-file#25843743
To have pickles load across python version and be reasonable fast/small we have to explicitly choose version 2 of the protocol.
The text was updated successfully, but these errors were encountered: