Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated behaviour (coroutine -> asyncio.task(...)) #266

Open
Infernum1 opened this issue May 27, 2023 · 0 comments
Open

Fix deprecated behaviour (coroutine -> asyncio.task(...)) #266

Infernum1 opened this issue May 27, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Infernum1
Copy link
Contributor

Infernum1 commented May 27, 2023

Describe Bug

Running the bot on Python ver3.11.3 throws an error in the karen terminal as shown below.

Error:

05-26-23 23:07:16 [asyncio] ERROR: Task exception was never retrieved
future: <Task finished name='Task-31' coro=<MechaKaren._connect_callback() done, defined at C:\Users\prana\OneDrive\Desktop\Villager-Bot\karen\karen.py:155> exception=TypeError('Passing coroutines is forbidden, use tasks explicitly.')>
Traceback (most recent call last):
  File "C:\Users\prana\OneDrive\Desktop\Villager-Bot\karen\karen.py", line 157, in _connect_callback
    await self._update_guild_diffs()
  File "C:\Users\prana\OneDrive\Desktop\Villager-Bot\karen\karen.py", line 181, in _update_guild_diffs
    itertools.chain.from_iterable(await self.server.broadcast(PacketType.FETCH_GUILD_IDS))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\prana\OneDrive\Desktop\Villager-Bot\common\coms\server.py", line 112, in broadcast
    await asyncio.wait(broadcast_coros)
  File "E:\Program Files\Python311\Lib\asyncio\tasks.py", line 415, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
E:\Program Files\Python311\Lib\asyncio\base_events.py:1923: RuntimeWarning: coroutine 'Server._send' was never awaited
  handle = None  # Needed to break cycles when an exception occurs.
RuntimeWarning: Enable tracemalloc to get the object allocation traceback```
@Iapetus-11 Iapetus-11 changed the title deprecated behaviour Fix deprecated behaviour (coroutine -> asyncio.task(...)) May 28, 2023
@Iapetus-11 Iapetus-11 added the bug Something isn't working label May 28, 2023
@Iapetus-11 Iapetus-11 added the help wanted Extra attention is needed label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants