Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WindowsSelectorEventLoopPolicy doesn't raise KeyboardInterrupt immediately #101166

Closed as duplicate of#77373
@davetapley

Description

@davetapley

Bug report

Run the snippet below andCtrl+C,
observeinterrupted will only be printed after ten seconds.

Comment outset_event_loop_policy and repeat,
observeinterrupted is printed immediately.

importasyncioimportsysifsys.platform=='win32':asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())asyncdefsleep():print('sleeping')awaitasyncio.sleep(10)print('done')try:asyncio.run(sleep())exceptKeyboardInterrupt:print('interrupted')

For context: I needWindowsSelectorEventLoopPolicy to mitigatethis error withpyzmq:

RuntimeError: Proactor event loop does not implement add_reader family of methods required for zmq. zmq will work with proactor if tornado >= 6.1 can be found. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` or install 'tornado>=6.1' to avoid this error.

Your environment

  • CPython versions tested on: 3.9.10
  • Operating system and architecture: Windows 10, 64-bit

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp