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 ' ' (tab), ' ', ' ' and ''."

For example:

json.loads(json_str, strict=False)
原文地址:https://www.cnblogs.com/turtle920/p/5299880.html