Author vstinner
Recipients aeros, asvetlov, cjrh, lukasz.langa, petr.viktorin, vstinner, yselivanov
Date 2020-04-20.12:59:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587387565.25.0.00532941783611.issue34037@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2020-04-20 12:59:25vstinnersetrecipients: + vstinner, petr.viktorin, asvetlov, cjrh, lukasz.langa, yselivanov, aeros
2020-04-20 12:59:25vstinnersetmessageid: <1587387565.25.0.00532941783611.issue34037@roundup.psfhosted.org>
2020-04-20 12:59:25vstinnerlinkissue34037 messages
2020-04-20 12:59:25vstinnercreate