Closed
Description
asyncio
errors on Python 3.11 (and older)
Caused by a regression in4.37.10
for an edge case.
This isn't happening on Python 3.12 (or newer).
Python 3.12 made improvements to asyncio
:

There's a recent SeleniumBase asyncio
memory-saving feature that works great on Python 3.12 (and newer), but it causes some asyncio
errors on 3.11 and older because those versions of Python have an asyncio
issue that wasn't fixed until Python 3.12.
This reproduces the issue on Python 3.11
:
from seleniumbase import SB
with SB(uc=True, test=True) as sb:
sb.activate_cdp_mode()
sb.open("data:text/html,<h1>Page A</h1>")
sb.assert_text("Page A")
sb.open_new_tab()
sb.open("data:text/html,<h1>Page B</h1>")
sb.assert_text("Page B")
sb.switch_to_tab(0)
sb.assert_text("Page A")
sb.assert_text_not_visible("Page B")
sb.switch_to_tab(1)
sb.assert_text("Page B")
sb.assert_text_not_visible("Page A")
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task cancelling name='Task-3' coro=<Listener.listener_loop() running at ~/SeleniumBase/seleniumbase/undetected/cdp_driver/connection.py:575> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Metadata
Metadata
Assignees
Labels
Undetected Chromedriver Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeUh oh... Something needs to be fixedUh oh... Something needs to be fixed