Skip to content

fix Route.abort not report handled#1458

Merged
rwoll merged 1 commit into
microsoft:mainfrom
x0day:patch-1
Jul 27, 2022
Merged

fix Route.abort not report handled#1458
rwoll merged 1 commit into
microsoft:mainfrom
x0day:patch-1

Conversation

@x0day
Copy link
Copy Markdown
Contributor

@x0day x0day commented Jul 27, 2022

this PR fixes #1457, #1402

@mxschmitt mxschmitt requested a review from rwoll July 27, 2022 14:14
@rwoll rwoll merged commit 5f95476 into microsoft:main Jul 27, 2022
@rwoll
Copy link
Copy Markdown
Member

rwoll commented Jul 27, 2022

@x0day Thanks for the contribution. Looks like this was missed in the port.

@FatMauld
Copy link
Copy Markdown

Is this still an issue? I'm using 1.27.1.
If I add this to my code:
page.route(re.compile(r"(\.png$)|(\.jpg$)"), lambda route: route.abort())

I've verified images don't load which is desired but when the script finishes, I get a bunch of these:

Task was destroyed but it is pending!
task: <Task pending name='Task-666' coro=<Page._on_route() running at /home/username/.local/lib/python3.8/site-packages/playwright/_impl/_page.py:251> wait_for=<_GatheringFuture finished exception=CancelledError()>>
_GatheringFuture exception was never retrieved
future: <_GatheringFuture finished exception=CancelledError()>
asyncio.exceptions.CancelledError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Task was destroyed but it is pending! in route.abort()

4 participants