saving and loading objects from file using jsonpickle

后端 未结 3 2038
迷失自我
迷失自我 2021-02-02 12:14

I have the following simple methods for writing a python object to a file using jsonpickle:

def json_serialize(obj, filename, use_jsonpickle=True):
    f = open(         


        
3条回答
  •  -上瘾入骨i
    2021-02-02 12:28

    As of this posting, there is a bug which causes encoding to be wrong if the serialized object is an inner class. Make sure the class is not located within another class. I've filed an issue with the maintainer. https://github.com/jsonpickle/jsonpickle/issues/210

提交回复
热议问题