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
When running pw sync code inside sg loop, pw complains that the blocking code was never awaited and runtime exception is thrown
Traceback (most recent call last): File "/home/el/workspace/contract/deriv/trade.py", line 59, in <module> trade_session.login(values['_EMAIL_'], values['_PWORD_']) File "/home/el/workspace/contract/deriv/session.py", line 23, in login self.page.goto("https://smarttrader.deriv.com/") File "/home/el/workspace/.venv/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 7328, in goto self._sync( File "/home/el/workspace/.venv/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 100, in _sync task = self._loop.create_task(coro) File "/usr/lib/python3.10/asyncio/base_events.py", line 431, in create_task self._check_closed() File "/usr/lib/python3.10/asyncio/base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed sys:1: RuntimeWarning: coroutine 'Page.goto' was never awaited
Could be because PW internally relies on asynchronous operations eg when using time.sleep(5) they can't get processed correctly. So the quick fix can be turning the whole codebase inside sp event loop to be async.
When running pw sync code inside sg loop, pw complains that the blocking code was never awaited and runtime exception is thrown
Traceback (most recent call last): File "/home/el/workspace/contract/deriv/trade.py", line 59, in <module> trade_session.login(values['_EMAIL_'], values['_PWORD_']) File "/home/el/workspace/contract/deriv/session.py", line 23, in login self.page.goto("https://smarttrader.deriv.com/") File "/home/el/workspace/.venv/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 7328, in goto self._sync( File "/home/el/workspace/.venv/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 100, in _sync task = self._loop.create_task(coro) File "/usr/lib/python3.10/asyncio/base_events.py", line 431, in create_task self._check_closed() File "/usr/lib/python3.10/asyncio/base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed sys:1: RuntimeWarning: coroutine 'Page.goto' was never awaited
Seems related to this pw issue 178
The text was updated successfully, but these errors were encountered: