NagarajuGunda / PyAlgoMate

114 stars 68 forks source link

Facing issue while running PyAlgomate.py in flet #28

Open shikharvaish28 opened 1 week ago

shikharvaish28 commented 1 week ago

Facing this issue in PyAlgomate.py in flet while Runner.py is running perfectly fine

[ERROR]|[2024-04-25 08:18:39,177]|[PID:62411::TID:8656894656]|[asyncio::base_events::default_exception_handler::1785]|=> Exception in callback _SelectorSocketTransport._read_ready()
handle: <Handle _SelectorSocketTransport._read_ready()>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: cannot enter context: <_contextvars.Context object at 0x307979540> is already entered
2024-04-25 08:18:39,177 asyncio [ERROR] Exception in callback _SelectorSocketTransport._read_ready()
handle: <Handle _SelectorSocketTransport._read_ready()>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: cannot enter context: <_contextvars.Context object at 0x307979540> is already entered
shikharvaish28 commented 1 week ago

Figured out that it is coming from the below function of telegram module's __init__.py

    def _runLoop(self):
        asyncio.set_event_loop(self.loop)
        self.loop.run_until_complete(
            asyncio.gather(self._sendMessages(), self.run()))

@NagarajuGunda