Closed saroele closed 8 years ago
I suspect it might be because you have pickled the object using Python2 and tried to unpickle it using Python3? Have you tried it with an object that was pickled in Python3?
You are probably right. I don't have an object pickled with python3 however. I'll try to create one and test
On Thu, Nov 19, 2015 at 7:26 PM, Jan Pecinovsky notifications@github.com wrote:
I suspect it might be because you have pickled the object using Python2 and tried to unpickle it using Python3? Have you tried it with an object that was pickled in Python3?
— Reply to this email directly or view it on GitHub https://github.com/opengridcc/opengrid/issues/78#issuecomment-158147025.
I solved the issue the hard way: by using jsonpickle instaed of pickle. Works perfectly!
For testing, we have a saved housprint object
/tests/test_saved_hp.hp
. In python2, this can be unpickled without problem, in Python3 this leads to a unicodedecode error. I tried to modify the unpickling as follows:It loads, but the resulting object is not correct and the subsequent tests fail.
I don't have a python3 machine configured to test. @JrtPec maybe you can solve this? Else we need to get rid of the pickle thing and use a json format for saving/loading houseprint objects?