You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# bot.pyfromtwitchio.extimportcommandsclassMyBot(commands.Bot):
def__init__(self, access_token: str):
# Initialise our Bot with our access token, prefix and a list of channels to join on boot...super().__init__(token=access_token, prefix='!', initial_channels=['...'])
asyncdefevent_ready(self):
# We are logged in and ready to chat and use commands...print(f'Logged in as | {self.nick}')
print(f'User id is | {self.user_id}')
@commands.command()asyncdefhello(self, ctx: commands.Context):
# Send a hello back!awaitctx.send(f'Hello {ctx.author.name}!')
When I run the program everything works fine, but when I try to debug my program I get:
Exception ignored in: <function Task.__del__ at 0x0000029BE865B420>
Traceback (most recent call last):
File "C:\Users\Manuel\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 150, in __del__
self._loop.call_exception_handler(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'call_exception_handler'
Traceback (most recent call last):
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\twitchio\client.py", line 159, in run
self.loop.run_until_complete(task) # this'll raise if the connect fails
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\JetBrains\PyCharm 2024.1.4\plugins\python\helpers-pro\pydevd_asyncio\pydevd_nest_asyncio.py", line 243, in run_until_complete
return f.result()
^^^^^^^^^^
File "C:\Users\Manuel\AppData\Local\Programs\Python\Python312\Lib\asyncio\futures.py", line 203, in result
raise self._exception.with_traceback(self._exception_tb)
File "C:\Users\Manuel\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 314, in __step_run_and_handle_result
result = coro.send(None)
^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\twitchio\client.py", line 192, in connect
await self._connection._connect()
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\twitchio\websocket.py", line 140, in _connect
data = await self._client._http.validate(token=self._token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\twitchio\http.py", line 298, in validate
async with self.session.get(url, headers=headers) as resp:
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\aiohttp\client.py", line 1418, in __aenter__
self._resp: _RetType = await self._coro
^^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\aiohttp\client.py", line 696, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\aiohttp\connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\aiohttp\connector.py", line 1050, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\aiohttp\connector.py", line 1345, in _create_direct_connection
hosts = await self._resolve_host(host, port, traces=traces)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\eft-troll\.venv\Lib\site-packages\aiohttp\connector.py", line 980, in _resolve_host
resolved_host_task = asyncio.Task(coro, loop=loop, eager_start=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _patch_task.<locals>.task_new_init() got an unexpected keyword argument 'eager_start'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2024.1.4\plugins\python\helpers\pydev\pydevd.py", line 1551, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\JetBrains\PyCharm 2024.1.4\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:\Users\Manuel\PycharmProjects\eft-troll\eft_troll\__main__.py", line 12, in <module>
bot.run()
File "C:\Users\Manuel\PycharmProjects\mybot\.venv\Lib\site-packages\twitchio\client.py", line 165, in run
self.loop.run_until_complete(self.close())
File "C:\Program Files\JetBrains\PyCharm 2024.1.4\plugins\python\helpers-pro\pydevd_asyncio\pydevd_nest_asyncio.py", line 243, in run_until_complete
return f.result()
^^^^^^^^^^
File "C:\Users\Manuel\AppData\Local\Programs\Python\Python312\Lib\asyncio\futures.py", line 203, in result
raise self._exception.with_traceback(self._exception_tb)
File "C:\Users\Manuel\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 314, in __step_run_and_handle_result
result = coro.send(None)
^^^^^^^^^^^^^^^
File "C:\Users\Manuel\PycharmProjects\mybot\.venv\Lib\site-packages\twitchio\client.py", line 200, in close
await self._connection._close()
File "C:\Users\Manuel\PycharmProjects\mybot\.venv\Lib\site-packages\twitchio\websocket.py", line 595, in _close
self._keeper.cancel()
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'cancel'
python-BaseException
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000029BE8F97CB0>
sys:1: RuntimeWarning: coroutine 'TCPConnector._resolve_host_with_throttle' was never awaited
any idea why?
The text was updated successfully, but these errors were encountered:
So I have the following program:
When I run the program everything works fine, but when I try to debug my program I get:
any idea why?
The text was updated successfully, but these errors were encountered: