Skip to content

fix: windows asyncio raises NotImplementedError#620

Open
waketzheng wants to merge 3 commits into
prompt-toolkit:mainfrom
waketzheng:fix-windows-asyncio
Open

fix: windows asyncio raises NotImplementedError#620
waketzheng wants to merge 3 commits into
prompt-toolkit:mainfrom
waketzheng:fix-windows-asyncio

Conversation

@waketzheng
Copy link
Copy Markdown

Fixes #582

@SaladDais
Copy link
Copy Markdown

Might be better to put the initial loop.add_signal_handler() in a try: ... except NotImplementedError: signals_supported = False and then skip the signal removal if signals aren't supported?

I think the inspect.getsource() approach may have issues if you're using a bundled interpreter with only bytecode for the stdlib files.

@waketzheng
Copy link
Copy Markdown
Author

Might be better to put the initial loop.add_signal_handler() in a try: ... except NotImplementedError: signals_supported = False and then skip the signal removal if signals aren't supported?

I think the inspect.getsource() approach may have issues if you're using a bundled interpreter with only bytecode for the stdlib files.

Nice suggestion — applied!

@SaladDais
Copy link
Copy Markdown

Would be great to have this merged! The mitigations that have to be implemented at the consumer level are very brittle, particularly as asyncio rearranges the platform-specific event loop implementations across versions.

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.

ptpython on Windows 11 in asyncio mode does not work

2 participants