代码:
body = '%s' % message.get_body()
logging.error(body)
parsed_body = json.loads(body)
正文包含:
[{u'content': u'Test\r\n', u'body_section': 1, u'charset': u'utf-8', u'type': u'text/plain'}, {u 'content': u'Test\r\n', u'body_section': 2, u'charset': u'utf-8', u'type': u'text/html'}]
错误:
line 67, in get
parsed_body = json.loads(body)
File "C:\Python27\lib\json\__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "C:\Python27\lib\json\decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
File "C:\Python27\lib\json\decoder.py", line 38, in errmsg
lineno, colno = linecol(doc, pos)
TypeError: 'NoneType' object is not callable
有人知道出了什么问题吗?