Closed
Description
Context:
- Playwright Version: v1.30.0
- Operating System: Windows
- Python version: 3.11.1
- Browser: All
Code Snippet
import asyncio
from playwright.async_api import async_playwright, Browser, Page
async def main() -> int:
async with async_playwright() as playwright:
browser: Browser = await playwright.chromium.launch()
page: Page = await browser.new_page()
await page.goto("https://github.com/microsoft/playwright-python")
await page.pause()
await browser.close()
return 0
if __name__ == "__main__":
raise SystemExit(asyncio.run(main()))
Describe the bug
When invoking page.pause()
an exception is raised: TypeError: Passing coroutines is forbidden, use tasks explicitly.
The following code snippet is responsible for this behavior:
playwright-python/playwright/_impl/_page.py
Lines 956 to 960 in 5ba8225
As per asyncio.wait: Changed in version 3.11: Passing coroutine objects to wait() directly is forbidden.
For context, this functionality has been deprecated since Python 3.8.
Metadata
Metadata
Assignees
Labels
No labels
Activity