Skip to content

Instantly share code, notes, and snippets.

@bofm
Created July 27, 2018 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bofm/b78818eb1cac0cc9a789e011340f5b8d to your computer and use it in GitHub Desktop.
Save bofm/b78818eb1cac0cc9a789e011340f5b8d to your computer and use it in GitHub Desktop.
asynctnt_err
Python 3.7.0 (default, Jun 29 2018, 09:12:54)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio, asynctnt
>>> asyncio.run(asynctnt.Connection(host='aa', port=1234).connect())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 568, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/site-packages/asynctnt/connection.py", line 289, in connect
await self.__create_reconnect_coro(True)
RuntimeError: Task <Task pending coro=<Connection.connect() running at /usr/local/lib/python3.7/site-packages/asynctnt/connection.py:289> cb=[_run_until_complete_cb() at /usr/local/lib/python3.7/asyncio/base_events.py:150]> got Future <Task pending coro=<Connection._connect() running at /usr/local/lib/python3.7/site-packages/asynctnt/connection.py:195>> attached to a different loop
>>> asyncio.set_event_loop(asyncio.new_event_loop())
>>> asyncio.run(asynctnt.Connection(host='aa', port=1234).connect())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 568, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/site-packages/asynctnt/connection.py", line 289, in connect
await self.__create_reconnect_coro(True)
RuntimeError: Task <Task pending coro=<Connection.connect() running at /usr/local/lib/python3.7/site-packages/asynctnt/connection.py:289> cb=[_run_until_complete_cb() at /usr/local/lib/python3.7/asyncio/base_events.py:150]> got Future <Task pending coro=<Connection._connect() running at /usr/local/lib/python3.7/site-packages/asynctnt/connection.py:195>> attached to a different loop
>>>
>>>
>>> asyncio.get_event_loop().run_until_complete(asynctnt.Connection(host='aa', port=1234).connect())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
>>> asyncio.get_event_loop()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
>>> asyncio.new_event_loop().run_until_complete(asynctnt.Connection(host='aa', port=1234).connect())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/asynctnt/connection.py", line 120, in __init__
self._loop = loop or asyncio.get_event_loop()
File "/usr/local/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
>>> asyncio.new_event_loop()
/usr/local/lib/python3.7/socket.py:493: RuntimeWarning: coroutine 'Connection._connect' was never awaited
b = socket(family, type, proto, b.detach())
Task was destroyed but it is pending!
task: <Task pending coro=<Connection._connect() running at /usr/local/lib/python3.7/site-packages/asynctnt/connection.py:195>>
Task was destroyed but it is pending!
task: <Task pending coro=<Connection._connect() running at /usr/local/lib/python3.7/site-packages/asynctnt/connection.py:195>>
<_UnixSelectorEventLoop running=False closed=False debug=False>
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment