Python json.loads ValueError, expecting delimiter

后端 未结 4 1202
后悔当初
后悔当初 2020-12-24 12:53

I am extracting a postgres table as json. The output file contains lines like:

{\"data\": {\"test\": 1, \"hello\": \"I have \\\" !\"}, \"id\": 4}
         


        
4条回答
  •  有刺的猬
    2020-12-24 13:20

    Try the ways source.replace('""', '') or sub it, cause "" in the source will make json.loads(source) can not distinguish them.

提交回复
热议问题