Closed eiffleduarte closed 4 years ago
Thanks for reporting!
For now you can work around it by passing conv_str_byte=True
to load
.
Although I haven't experimented with using open
for load
but a string for dump
, it looks like it should work. So my impression is that it should work without the conv_str_byte=True
workaround. I'll see what I can do.
Another workaround, somewhat amusingly, is to enable compression, since that forces binary mode. It might also save space if the result matrix is bigger than the example.
dump(res, open("test.json","wb"), compression=True)
Version 3.14.0 solved the issue, and added some tests.
It seems like this issue must've affected a number of people, so thanks for reporting it, I'm glad it's finally solved!
I upgraded to 3.14.0 and everything works fine.
Thanks for fixing it so fast and even updating the conda package!
Thanks @eiffleduarte though I think @jhkennedy maintains the Conda package (#49), not me
@eiffleduarte you're welcome on the conda package! Though, really, the conda-forge bot does most of the work, I just do a quick check and hit merge most of the time.
I was trying to use
json_tricks
to store optimization results obtained withscipy.optimize.minimize
. However, I cannot load the dumped objects withjson_tricks.load
. I expected to be able to load any file generated with dump seamlessly.Is there a way to avoid this error? Did I do something wrong?
Example (using example code from https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize)