Skip to content

Use WindowsProactorEventLoopPolicy on Windows #17467

Description

Resurfacing #16395; upstream fix is in progress, so there should be a way to track this again.

chmielcode opened on Jan 22, 2025

Currently it is not possible to use asyncio subprocess handling capabilities with vscode jupyter notebook or interactive window. At the same time I can use them with plain terminal-based ipython.

The reason is that vscode uses WindowsSelectorEventLoopPolicy instead of WindowsProactorEventLoopPolicy.

Calling asyncio.set_event_loop_policy inside the vscode notebook is of no effect.
Setting event loop policy in ~/.ipython/profile_default/startup/ python script makes vscode hang and never execute the first cell.

Would it be possible to switch to WindowsProactorEventLoopPolicy?

The upstream fix has now merged into ipykernel main via ipython/ipykernel#1469 and is expected to ship in the next minor release, more likely ipykernel 7.4.0 than 7.3.1.

When the release comes, bumping the dependency in ones own project would simply suffice, and no action is needed from vscode-jupyter.

I would hope strongly again that if the maintainer is closing a issue that is not completed with a good reason, don't mark it as "completed". An issue reflecting an upstream problem is often bound to see sure but late progress, and leaving the issue open, or at least not locked, goes a long way to help communicate the situation and intention.

Activity

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

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions