Skip to content

fix(sync): do not log CancelledError for pending handlers on exit - #3267

Closed
Yury Semikhatsky (yury-s) wants to merge 1 commit into
mainfrom
fix-playwright-43463
Closed

Yury Semikhatsky (yury-s) wants to merge 1 commit into
mainfrom
fix-playwright-43463

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

  • Exiting sync_playwright() cancels the pending tasks in the loop it owns. The done callback attached to event handler tasks called Future.exception() on the cancelled future, which raises CancelledError, so asyncio logged "Exception in callback" for a route handler that was still waiting.
  • Return early for a cancelled future.

Fixes #3272

Exiting sync_playwright() cancels pending tasks in the loop it owns. The
done callback that reports handler errors called Future.exception() on the
cancelled future, which raises CancelledError and made asyncio log it.

Fixes: https://github.com/microsoft/playwright/issues/43463
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]: Python sync API logs CancelledError when exiting sync_playwright() with an unanswered route

3 participants