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
1.clone this easy code example https://github.com/Haohao268826/PlayWrightRepo.git
2.On a Windows machine with Python (downloaded from python.org) installed and added to PATH.
3.pip install playwright
4.playwright install chromium
5.run python repoBug.py
6.Expected Behavior:
The script should launch a headless Chromium browser, navigate to example.com, print the title, and then close
Expected behavior
Print the log message: INFO:main:WindowsSelectorEventLoopPolicy has been set for minimal test.
Print the log message: INFO:main:Starting minimal Playwright test...
Successfully launch a headless Chromium browser instance managed by Playwright.
Print the log message: INFO:main:Browser launched.
Create a new browser page.
Print the log message: INFO:main:New page created.
Navigate the page to https://example.com.
Print a log message similar to: INFO:main:Navigated to example.com, page title: Example Domain
Close the browser cleanly.
Print the log message: INFO:main:Browser closed.
The script should then exit gracefully with a return code of 0, indicating success. No NotImplementedError or other critical errors should occur.
Actual behavior
errors.
Actual Behavior:
The script fails with a NotImplementedError originating from asyncio.base_events.py in the _make_subprocess_transport method. The WindowsSelectorEventLoopPolicy confirmation message is printed, indicating the policy was set.
Full Error Log:INFO:main:Starting minimal Playwright test...
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-2' coro=<Connection.run() done, defined at C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_connection.py:272> exception=NotImplementedError()>
Traceback (most recent call last):
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_connection.py", line 279, in run
await self._transport.connect()
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_transport.py", line 133, in connect
raise exc
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_transport.py", line 120, in connect
self._proc = await asyncio.create_subprocess_exec(
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\asyncio\subprocess.py", line 236, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1676, in subprocess_exec
transport = await self._make_subprocess_transport(
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 498, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
CRITICAL:main:Top-level error occurred while running minimal test:
Traceback (most recent call last):
Additional context
This issue has been reproduced on two different Windows machines following the same setup steps (fresh Python from python.org, new virtual environment, fresh Playwright install).
The Python Scripts directory is confirmed to be in the system PATH.
The playwright install chromium command completes successfully without apparent errors.
Using Playwright's bundled Chromium (i.e., not providing executable_path to launch()).
Attempts to use different Python minor versions (e.g., previously tried Python 3.11 with the same error, now on Python [3.11]]) did not resolve the issue.
A complete uninstall (pip uninstall playwright, playwright uninstall) ayatannd reinstall (including pip cache purge) was performed before the latest test, with no change in outcome.
I suspect this might be a deeper compatibility issue between Playwright's subprocess management via asyncio and certain Windows environments or specific Python [Your Python Version] builds, despite the WindowsSelectorEventLoopPolicy being active.
Any insights or suggestions would be greatly appreciated. Thank you!
Version
latest
Steps to reproduce
1.clone this easy code example https://github.com/Haohao268826/PlayWrightRepo.git
2.On a Windows machine with Python (downloaded from python.org) installed and added to PATH.
3.pip install playwright
4.playwright install chromium
5.run python repoBug.py
6.Expected Behavior:
The script should launch a headless Chromium browser, navigate to example.com, print the title, and then close
Expected behavior
Print the log message: INFO:main:WindowsSelectorEventLoopPolicy has been set for minimal test.
Print the log message: INFO:main:Starting minimal Playwright test...
Successfully launch a headless Chromium browser instance managed by Playwright.
Print the log message: INFO:main:Browser launched.
Create a new browser page.
Print the log message: INFO:main:New page created.
Navigate the page to https://example.com.
Print a log message similar to: INFO:main:Navigated to example.com, page title: Example Domain
Close the browser cleanly.
Print the log message: INFO:main:Browser closed.
The script should then exit gracefully with a return code of 0, indicating success. No NotImplementedError or other critical errors should occur.
Actual behavior
errors.
Actual Behavior:
The script fails with a NotImplementedError originating from asyncio.base_events.py in the _make_subprocess_transport method. The WindowsSelectorEventLoopPolicy confirmation message is printed, indicating the policy was set.
Full Error Log:INFO:main:Starting minimal Playwright test...
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-2' coro=<Connection.run() done, defined at C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_connection.py:272> exception=NotImplementedError()>
Traceback (most recent call last):
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_connection.py", line 279, in run
await self._transport.connect()
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_transport.py", line 133, in connect
raise exc
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright_impl_transport.py", line 120, in connect
self._proc = await asyncio.create_subprocess_exec(
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\asyncio\subprocess.py", line 236, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1676, in subprocess_exec
transport = await self._make_subprocess_transport(
File "C:\Users\Hao\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 498, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
CRITICAL:main:Top-level error occurred while running minimal test:
Traceback (most recent call last):
Additional context
This issue has been reproduced on two different Windows machines following the same setup steps (fresh Python from python.org, new virtual environment, fresh Playwright install).
The Python Scripts directory is confirmed to be in the system PATH.
The playwright install chromium command completes successfully without apparent errors.
Using Playwright's bundled Chromium (i.e., not providing executable_path to launch()).
Attempts to use different Python minor versions (e.g., previously tried Python 3.11 with the same error, now on Python [3.11]]) did not resolve the issue.
A complete uninstall (pip uninstall playwright, playwright uninstall) ayatannd reinstall (including pip cache purge) was performed before the latest test, with no change in outcome.
I suspect this might be a deeper compatibility issue between Playwright's subprocess management via asyncio and certain Windows environments or specific Python [Your Python Version] builds, despite the WindowsSelectorEventLoopPolicy being active.
Any insights or suggestions would be greatly appreciated. Thank you!
Environment
The text was updated successfully, but these errors were encountered: