➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 vstinner
收信人 asvetlov, vstinner, yselivanov
日期 2018-06-07.10:02:04
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1528365724.38.0.592728768989.issue33792@psf.upfronthosting.co.za>
In-reply-to
内容
asyncio documentation suggets to use:
---
import asyncio, sys

if sys.platform == 'win32':
    loop = asyncio.ProactorEventLoop()
    asyncio.set_event_loop(loop)
---
https://docs.python.org/dev/library/asyncio-eventloops.html

But this code doesn't work with asyncio.run() which creates a new event loop with the current policy, and the default policy on Windows is to use SelectorEventLoop.

I cannot find a "Proactor event loop policy" in asyncio, nor how to change the default policy to use Proactor event loop.

The workaround is to not use asyncio.run() which has been added in Python 3.7.
历史
日期 用户 动作 参数
2018-06-07 10:02:04vstinner修改recipients: + vstinner, asvetlov, yselivanov
2018-06-07 10:02:04vstinner修改messageid: <1528365724.38.0.592728768989.issue33792@psf.upfronthosting.co.za>
2018-06-07 10:02:04vstinner链接issue33792 messages
2018-06-07 10:02:04vstinner创建