json.loads(s) returns error message like this: ValueError: Invalid control character at: line 1 column 33 (char 33)

json.loads(s) returns error message like this:

ValueError: Invalid control character at: line 1 column 33 (char 33)


According to http://docs.python.org/2/library/json.html

"If strict is False (True is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including '\t' (tab), '\n', '\r' and '\0'."

For example:

json.loads(json_str, strict=False)
posted @ 2016-03-20 22:05  龟窝  阅读(302)  评论(0编辑  收藏  举报