开发者

Python: escaping issue with ujson

I am using ujson to convert dictionary to json. w开发者_运维百科hen I run the following line:

ujson.dumps({'key':'val\1'})

I get the following result:

[{"key": "val\\1"}]

while I expect/want it to be:

[{"key": "val\1"}]

any idea?


There is no problem, that's what repr looks like for this value. It is \1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜