启动vntrader 交易窗口输入合约代码回车,报以下错误:
File "D:\ProgramData\Anaconda2\lib\json\encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: datetime.datetime(2019, 2, 12, 11, 3, 5) is not JSON serializable
这个时期序列化错误,在什么位置怎么解决呢?
2019-02-12 11:03:11,881 INFO: MAIN_ENGINE MongoDB连接成功
2019-02-12 11:03:13,061 INFO: CTP 行情服务器连接成功
2019-02-12 11:03:13,095 INFO: CTP 行情服务器登录完成
2019-02-12 11:03:13,292 INFO: CTP 交易服务器连接成功
2019-02-12 11:03:13,357 INFO: CTP 交易服务器登录完成
2019-02-12 11:03:13,388 INFO: CTP 结算信息确认完成
2019-02-12 11:03:13,526 INFO: CTP 交易合约信息获取完成
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\ProgramData\Anaconda2\lib\threading.py", line 801, in bootstrap_inner
self.run()
File "D:\ProgramData\Anaconda2\lib\threading.py", line 754, in run
self.target(*self.args, **self.kwargs)
File "D:\python ITEM\vnpy-1.9.2\vnpy-1.9.2\vnpy\event\eventEngine.py", line 83, in run
self.process(event)
File "D:\python ITEM\vnpy-1.9.2\vnpy-1.9.2\vnpy\event\eventEngine.py", line 93, in process
[handler(event) for handler in self.handlers[event.type]]
File "D:\python ITEM\vnpy-1.9.2\vnpy-1.9.2\vnpy\trader\app\rtdService\rtdEngine.py", line 76, in processDataEvent
self.server.publish(event.type, d)
File "D:\python ITEM\vnpy-1.9.2\vnpy-1.9.2\vnpy\rpc\vnrpc.py", line 187, in publish
datab = self.pack(data)
File "D:\python ITEM\vnpy-1.9.2\vnpy-1.9.2\vnpy\rpc\vnrpc.py", line 57, in jsonPack
return dumps(data)
File "D:\ProgramData\Anaconda2\lib\json\init__.py", line 244, in dumps
return _default_encoder.encode(obj)
File "D:\ProgramData\Anaconda2\lib\json\encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "D:\ProgramData\Anaconda2\lib\json\encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "D:\ProgramData\Anaconda2\lib\json\encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: datetime.datetime(2019, 2, 12, 11, 3, 5) is not JSON serializable