← 输入框|bugs.python.org|刷新

➜

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
收信人 aeros, asvetlov, cjrh, lukasz.langa, petr.viktorin, vstinner, yselivanov
日期 2020-04-20.12:59:25
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1587387565.25.0.00532941783611.issue34037@roundup.psfhosted.org>
In-reply-to
内容
I reopen the issue.

> /usr/lib64/python3.9/asyncio/events.py:254: in shutdown_default_executor
>     raise NotImplementedError

That means that the project (python-anyio) implements its own event loop which inherits from AbstractEventLoop, it doesn't use BaseEventLoop which implements shutdown_default_executor().

AbstractEventLoop documentation says:

https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.AbstractEventLoop

"The Event Loop Methods section lists all methods that an alternative implementation of AbstractEventLoop should have defined."

It points to the following documentation which lists shutdown_asyncgens():

It points to https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio-event-loop


> I'm not all that familiar with asyncio, but it seems to me that all event loops inherited from BaseEventLoop must be updated to implement this new method to correctly work with run() in Python 3.9. Is that right?

Yes

> If it is, this needs at least a much more prominent What's New entry. Or the hard NotImplementedError should turn into a warning.

Raising NotImplementedError is a deliberate design choice.

Documentation the new requirement in the following section sounds like a good idea.

https://docs.python.org/dev/whatsnew/3.9.html#changes-in-the-python-api

Kyle: Can you please add a short sentence there to document the new requirement?
历史
日期 用户 动作 参数
2020-04-20 12:59:25vstinner修改recipients: + vstinner, petr.viktorin, asvetlov, cjrh, lukasz.langa, yselivanov, aeros
2020-04-20 12:59:25vstinner修改messageid: <1587387565.25.0.00532941783611.issue34037@roundup.psfhosted.org>
2020-04-20 12:59:25vstinner链接issue34037 messages
2020-04-20 12:59:25vstinner创建