ipykernel should use default `WindowsProactorEventLoopPolicy` rather than `WindowsSelectorEventLoopPolicy` for windows
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- backend, operating-systems
Direzione di ricerca
Inizia dal blocco della policy del ciclo di eventi Windows in init() e leggi le pull request e le issue indicate, in particolare la modifica annullata e la issue 1190. Determina il rischio di regressione prima di modificare la policy, quindi verifica che il codice asyncio di Windows che usa create_subprocess_exec funzioni senza il problema segnalato in precedenza.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
there were some issues discussed about this problem before https://github.com/ipython/ipykernel/pull/1184,
then https://github.com/ipython/ipykernel/issues/1190 caused https://github.com/ipython/ipykernel/pull/1194 reverted the above PR.
I tried the https://github.com/ipython/ipykernel/issues/1190 but it's unable to reproduce now in ipykernel version 7.1.
the asyncio on windows needs WindowsProactorEventLoopPolicy to have the ability to use create_subprocess_exec, which is used in practice places, for example:
- using playwright which is a new automation tools after selenium.
import asyncio
from playwright.async_api import async_playwright
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
await page.goto("https://playwright.dev")
print(await page.title())
await browser.close()
await main()
# asyncio.run(main())
on windows, the above codes is not useable in ipython, junpyter, or jupyter notebook in vscode because of WindowsSelectorEventLoopPolicy lacking of create_subprocess_exec
- a another use case like a issue in this repo https://github.com/ipython/ipykernel/issues/391, this PR using default event loop
WindowsProactorEventLoopPolicycan also close this issue.
Even If the above https://github.com/ipython/ipykernel/issues/1190 is still reproduceable, then should fix it, to make asyncio create_subprocess_exec is working on windows in jupyter.
therefore I created a PR again to get rid of using WindowsSelectorEventLoopPolicy on windows, since https://github.com/ipython/ipykernel/releases/tag/v7.0.0 dropped support for python 3.9, so the PR is simply removing the whole block code of the init() that checked python version
ps.
there is a old issue before https://github.com/ipython/ipykernel/pull/1184 which talked about that tornado 6.1 used background threads and which may reduce performance, but result of running test in https://github.com/ipython/ipykernel/pull/1184 showed performance improved rather than reduced. and that asyncio on windows has ability to use a common api create_subprocess_exec should be more important than threads in background problem
- Lingua principale
- Python
- Stelle
- 734
- Fork
- 411
- Merge medio
- 1g 2h
- PR unite (30g)
- 9
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ipython/ipykernel
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
-
ipython/ipykernel#1550 · 1 commento · 1 reazione · 1 assegnatario ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
Tutte le issue di ipython/ipykernel
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
triage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentscope-ai/agentscope#2775 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
comp/desktop P3 type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NousResearch/hermes-agent#118866 ·