2.34K 浏览
0

2020-08-18 21:22:49,391 -   INFO - 通知: 登录成功
Task was destroyed but it is pending!
task: <Task pending name='Task-1' coro=<TqApi._windows_patch() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py:1689> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E8630B2AF0>()]> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name='Task-2' coro=<TqApi._notify_watcher() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py:1697> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86C09AC40>()]> cb=[TqApi._on_task_done()]>
Exception ignored in: <coroutine object TqApi._notify_watcher at 0x000001E863167C40>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py", line 1697, in _notify_watcher
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\channel.py", line 110, in __anext__
  File "C:\Program Files\Python38\lib\asyncio\queues.py", line 165, in get
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py", line 1223, in _call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 719, in call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending name='Task-3' coro=<TqApi._connect() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py:1759> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86C09AA60>()]> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name='Task-4' coro=<TqApi._connect() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py:1759> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E8631C8D90>()]> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name='Task-5' coro=<TqAccount._run() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\account.py:85> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86A6E61C0>()]> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<TqWebHelper._run() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\tqwebhelper.py:76> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86A6E64F0>()]> cb=[TqApi._on_task_done()]>
Exception ignored in: <coroutine object TqApi._connect at 0x000001E863167940>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py", line 1859, in _connect
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\client.py", line 525, in __aexit__
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py", line 676, in close
  File "C:\Program Files\Python38\lib\asyncio\tasks.py", line 448, in wait_for
RuntimeError: no running event loop
sys:1: RuntimeWarning: coroutine 'WebSocketCommonProtocol.write_close_frame' was never awaited
Task was destroyed but it is pending!
task: <Task pending name='Task-15' coro=<TqApi._send_handler() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py:1896> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object TqApi._connect at 0x000001E850B52040>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py", line 1859, in _connect
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\client.py", line 525, in __aexit__
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py", line 676, in close
  File "C:\Program Files\Python38\lib\asyncio\tasks.py", line 448, in wait_for
RuntimeError: no running event loop
Task was destroyed but it is pending!
task: <Task pending name='Task-21' coro=<TqApi._send_handler() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py:1896> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object TqAccount._run at 0x000001E850B52140>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\account.py", line 91, in _run
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py", line 1223, in _call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 719, in call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending name='Task-7' coro=<TqAccount._md_handler() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\account.py:95> wait_for=<Future cancelled>>
Exception ignored in: <coroutine object TqWebHelper._run at 0x000001E8631ACCC0>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\tqwebhelper.py", line 81, in _run
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py", line 1223, in _call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 719, in call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending name='Task-9' coro=<TqWebHelper._data_handler_without_web() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\tqwebhelper.py:150> wait_for=<Future cancelled>>
Task was destroyed but it is pending!
task: <Task pending name='Task-8' coro=<TqAccount._td_handler() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\account.py:102> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86A6E6670>()]>>
Exception ignored in: <coroutine object TqAccount._td_handler at 0x000001E869320440>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\account.py", line 102, in _td_handler
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\channel.py", line 110, in __anext__
  File "C:\Program Files\Python38\lib\asyncio\queues.py", line 165, in get
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\tqsdk\api.py", line 1223, in _call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 719, in call_soon
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
RuntimeError: Event loop is closed
Task was destroyed but it is pending!
task: <Task pending name='Task-18' coro=<WebSocketCommonProtocol.transfer_data() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:827> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86C09A5B0>()]> cb=[<TaskWakeupMethWrapper object at 0x000001E86A6E6160>()]>
Task was destroyed but it is pending!
task: <Task pending name='Task-19' coro=<WebSocketCommonProtocol.keepalive_ping() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:1119> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86A6E6130>()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-20' coro=<WebSocketCommonProtocol.close_connection() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:1169> wait_for=<Task pending name='Task-18' coro=<WebSocketCommonProtocol.transfer_data() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:827> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86C09A5B0>()]> cb=[<TaskWakeupMethWrapper object at 0x000001E86A6E6160>()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-12' coro=<WebSocketCommonProtocol.transfer_data() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:827> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86C09AA90>()]> cb=[<TaskWakeupMethWrapper object at 0x000001E86C09AB50>()]>
Exception ignored in: <coroutine object WebSocketCommonProtocol.close_connection at 0x000001E86C0AD840>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py", line 1206, in close_connection
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py", line 1226, in wait_for_connection_lost
  File "C:\Program Files\Python38\lib\asyncio\tasks.py", line 448, in wait_for
RuntimeError: no running event loop
Task was destroyed but it is pending!
task: <Task pending name='Task-13' coro=<WebSocketCommonProtocol.keepalive_ping() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:1119> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86C09AB20>()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-14' coro=<WebSocketCommonProtocol.close_connection() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:1169> wait_for=<Task pending name='Task-12' coro=<WebSocketCommonProtocol.transfer_data() running at C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py:827> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000001E86C09AA90>()]> cb=[<TaskWakeupMethWrapper object at 0x000001E86C09AB50>()]>>
Exception ignored in: <coroutine object WebSocketCommonProtocol.close_connection at 0x000001E8693202C0>
Traceback (most recent call last):
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py", line 1206, in close_connection
  File "C:\Users\mojb\AppData\Roaming\Python\Python38\site-packages\websockets\protocol.py", line 1226, in wait_for_connection_lost
  File "C:\Program Files\Python38\lib\asyncio\tasks.py", line 448, in wait_for
RuntimeError: no running event loop

lookis 已回答的问题 2020年8月19日
0

得看代码,看上去感觉像是没有 wait_update

mojiabin 发表新评论 2020年8月20日

from tqsdk import TqAccount, TqApi

api = TqApi(TqAccount(“G国泰君安”, “资金帐号”, “交易密码”)

就这两行而已,就报那个错了,大神们帮忙看看是怎么回事

您正在查看1个答案中的1个,单击此处查看所有答案。