2.79K 浏览
0

实盘交易中出以下大段提示,之后自己以正常了,有问题吗?

Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._windows_patch() running at C:\Python37\lib\site-packages\tqsdk\api.py:1689> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x0DB32E90>()]> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._notify_watcher() running at C:\Python37\lib\site-packages\tqsdk\api.py:1697> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x06D5BA10>()]> cb=[TqApi._on_task_done()]>
Exception ignored in: <coroutine object TqApi._notify_watcher at 0x06D80420>
Traceback (most recent call last):
File “C:\Python37\lib\site-packages\tqsdk\api.py”, line 1697, in _notify_watcher
async for _ in update_chan:
File “C:\Python37\lib\site-packages\tqsdk\channel.py”, line 110, in __anext__
value = await asyncio.Queue.get(self)
File “C:\Python37\lib\asyncio\queues.py”, line 161, in get
getter.cancel() # Just in case getter is not done yet.
File “C:\Python37\lib\site-packages\tqsdk\api.py”, line 1223, in _call_soon
return org_call_soon(callback, *args, **kargs)
File “C:\Python37\lib\asyncio\base_events.py”, line 683, in call_soon
self._check_closed()
File “C:\Python37\lib\asyncio\base_events.py”, line 475, in _check_closed
raise RuntimeError(‘Event loop is closed’)
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._connect() running at C:\Python37\lib\site-packages\tqsdk\api.py:1759> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10476EF0>()]> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending coro=<TqSim._run() running at C:\Python37\lib\site-packages\tqsdk\sim.py:103> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x0D84C510>()]> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending coro=<TqWebHelper._run() running at C:\Python37\lib\site-packages\tqsdk\tqwebhelper.py:76> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10476EB0>()]> cb=[TqApi._on_task_done()]>
Exception ignored in: <coroutine object TqApi._connect at 0x05574D68>
Traceback (most recent call last):
File “C:\Python37\lib\site-packages\tqsdk\api.py”, line 1859, in _connect
await send_task
File “C:\Python37\lib\site-packages\websockets\client.py”, line 525, in __aexit__
await self.ws_client.close()
File “C:\Python37\lib\site-packages\websockets\protocol.py”, line 679, in close
loop=self.loop if sys.version_info[:2] < (3, 8) else None,
File “C:\Python37\lib\asyncio\tasks.py”, line 426, in wait_for
timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
File “C:\Python37\lib\asyncio\base_events.py”, line 652, in call_later
context=context)
File “C:\Python37\lib\asyncio\base_events.py”, line 662, in call_at
self._check_closed()
File “C:\Python37\lib\asyncio\base_events.py”, line 475, in _check_closed
raise RuntimeError(‘Event loop is closed’)
RuntimeError: Event loop is closed
C:\Python37\lib\collections\__init__.py:414: RuntimeWarning: coroutine ‘WebSocketCommonProtocol.write_close_frame’ was never awaited
result = _self._make(map(kwds.pop, field_names, _self))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Task was destroyed but it is pending!
task: <Task pending coro=<TqApi._send_handler() running at C:\Python37\lib\site-packages\tqsdk\api.py:1896> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object TqSim._run at 0x06D223D8>
Traceback (most recent call last):
File “C:\Python37\lib\site-packages\tqsdk\sim.py”, line 140, in _run
await self._send_stat_report()
File “C:\Python37\lib\site-packages\tqsdk\sim.py”, line 184, in _send_stat_report
“_tqsdk_stat”: self._tqsdk_stat
File “C:\Python37\lib\site-packages\tqsdk\channel.py”, line 49, in send
await asyncio.Queue.put(self, item)
File “C:\Python37\lib\asyncio\queues.py”, line 136, in put
return self.put_nowait(item)
File “C:\Python37\lib\asyncio\queues.py”, line 148, in put_nowait
self._wakeup_next(self._getters)
File “C:\Python37\lib\asyncio\queues.py”, line 66, in _wakeup_next
waiter.set_result(None)
File “C:\Python37\lib\site-packages\tqsdk\api.py”, line 1223, in _call_soon
return org_call_soon(callback, *args, **kargs)
File “C:\Python37\lib\asyncio\base_events.py”, line 683, in call_soon
self._check_closed()
File “C:\Python37\lib\asyncio\base_events.py”, line 475, in _check_closed
raise RuntimeError(‘Event loop is closed’)
RuntimeError: Event loop is closed
Exception ignored in: <coroutine object TqWebHelper._run at 0x06D2E660>
RuntimeError: coroutine ignored GeneratorExit
Task was destroyed but it is pending!
task: <Task cancelling coro=<TqWebHelper._data_handler_without_web() running at C:\Python37\lib\site-packages\tqsdk\tqwebhelper.py:150> wait_for=<Future finished result=None> cb=[gather.<locals>._done_callback() at C:\Python37\lib\asyncio\tasks.py:691]>
Task was destroyed but it is pending!
task: <Task pending coro=<WebSocketCommonProtocol.transfer_data() running at C:\Python37\lib\site-packages\websockets\protocol.py:827> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10476D90>()]> cb=[<TaskWakeupMethWrapper object at 0x10476CD0>()]>
Task was destroyed but it is pending!
task: <Task pending coro=<WebSocketCommonProtocol.keepalive_ping() running at C:\Python37\lib\site-packages\websockets\protocol.py:1121> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10476CB0>()]>>
Task was destroyed but it is pending!
task: <Task pending coro=<WebSocketCommonProtocol.close_connection() running at C:\Python37\lib\site-packages\websockets\protocol.py:1169> wait_for=<Task pending coro=<WebSocketCommonProtocol.transfer_data() running at C:\Python37\lib\site-packages\websockets\protocol.py:827> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10476D90>()]> cb=[<TaskWakeupMethWrapper object at 0x10476CD0>()]>>
Exception ignored in: <coroutine object WebSocketCommonProtocol.close_connection at 0x104784F8>
Traceback (most recent call last):
File “C:\Python37\lib\site-packages\websockets\protocol.py”, line 1206, in close_connection
if await self.wait_for_connection_lost():
File “C:\Python37\lib\site-packages\websockets\protocol.py”, line 1229, in wait_for_connection_lost
loop=self.loop if sys.version_info[:2] < (3, 8) else None,
File “C:\Python37\lib\asyncio\tasks.py”, line 426, in wait_for
timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
File “C:\Python37\lib\asyncio\base_events.py”, line 652, in call_later
context=context)
File “C:\Python37\lib\asyncio\base_events.py”, line 662, in call_at
self._check_closed()
File “C:\Python37\lib\asyncio\base_events.py”, line 475, in _check_closed
raise RuntimeError(‘Event loop is closed’)
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending coro=<TqSim._md_handler() running at C:\Python37\lib\site-packages\tqsdk\sim.py:149> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10476BF0>()]>>
Exception ignored in: <coroutine object TqSim._md_handler at 0x06D80AE0>
Traceback (most recent call last):
File “C:\Python37\lib\site-packages\tqsdk\sim.py”, line 149, in _md_handler
async for pack in self._md_recv_chan:
File “C:\Python37\lib\site-packages\tqsdk\channel.py”, line 110, in __anext__
value = await asyncio.Queue.get(self)
File “C:\Python37\lib\asyncio\queues.py”, line 161, in get
getter.cancel() # Just in case getter is not done yet.
File “C:\Python37\lib\site-packages\tqsdk\api.py”, line 1223, in _call_soon
return org_call_soon(callback, *args, **kargs)
File “C:\Python37\lib\asyncio\base_events.py”, line 683, in call_soon
self._check_closed()
File “C:\Python37\lib\asyncio\base_events.py”, line 475, in _check_closed
raise RuntimeError(‘Event loop is closed’)
RuntimeError: Event loop is closed

李思恒 已回答的问题 2020年9月4日
0

你检查下看看有没有用api.close

李思恒 已回答的问题 2020年9月4日