문제

I am trying to read and save a json file. The problem is that when I call write_json(pt, "newFile.json") it is changing the content of some fields like:

input:

"field1":"path/to/file.txt"

is changed to:

"field1":"path\/to\/file.txt"

Is this a bug? How to fix it?

도움이 되었습니까?

해결책

It means it escapes the forward slash. The JSON spec says you can escape forward slash, but it's not mandatory. As for the reason, here is a good explanation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top