Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

RuntimeError: no running event loop #2

Open
ciripel opened this issue Oct 12, 2020 · 3 comments
Open

RuntimeError: no running event loop #2

ciripel opened this issue Oct 12, 2020 · 3 comments

Comments

@ciripel
Copy link

ciripel commented Oct 12, 2020

Hi,
I have tested this with your simple example and this is what i got... Tried a lot of things with loop but did not arrive till the bottom of it and could not fix it...
Can you please try it on your end and check it out pls?

Traceback (most recent call last):
  File "./bot1.py", line 17, in <module>
    client = discord.Client()
  File "/home/ciripel/.local/share/virtualenvs/Heimdall-KBghI6eB/lib/python3.7/site-packages/discord/client.py", line 259, in __init__
    log.warning("PyNaCl is not installed, voice will NOT be supported")
  File "/home/ciripel/anaconda3/lib/python3.7/logging/__init__.py", line 1395, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/home/ciripel/anaconda3/lib/python3.7/logging/__init__.py", line 1519, in _log
    self.handle(record)
  File "/home/ciripel/anaconda3/lib/python3.7/logging/__init__.py", line 1529, in handle
    self.callHandlers(record)
  File "/home/ciripel/anaconda3/lib/python3.7/logging/__init__.py", line 1591, in callHandlers
    hdlr.handle(record)
  File "/home/ciripel/anaconda3/lib/python3.7/logging/__init__.py", line 905, in handle
    self.emit(record)
  File "/home/ciripel/Programe/Heimdall/discord_logging.py", line 17, in emit
    asyncio.create_task(self.emitting(record))
  File "/home/ciripel/anaconda3/lib/python3.7/asyncio/tasks.py", line 324, in create_task
    loop = events.get_running_loop()
RuntimeError: no running event loop
sys:1: RuntimeWarning: coroutine 'Discord_Handler.emitting' was never awaited
@AlexNovikovRussian
Copy link

this is an error of discord.py, not discord_logging
I had the same problem, and it disappeared on updating discord.py module

@ciripel
Copy link
Author

ciripel commented Dec 22, 2020

I always use the latest version of discord.py. Can you pls tell me with what version of discord.py is your example working?

@AlexNovikovRussian
Copy link

AlexNovikovRussian commented Dec 22, 2020

I always use the latest version of discord.py. Can you pls tell me with what version of discord.py is your example working?

sorry, i had this problem many time before. now i check code of this rep: there is a bug on awaiting the coroutine from not async function, i think that this bug doesn't seem to be fixable due to logging module doesn't await the function 'emit', where the problem located

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants