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.

Author nmatravolgyi
Recipients asvetlov, nmatravolgyi, yselivanov
Date 2021-03-03.21:18:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614806289.45.0.299347842878.issue43389@roundup.psfhosted.org>
In-reply-to
Content
I've quickly wanted to create a suitable solution for myself. I made a small library with a asyncio.wait_for()-like function using asyncio.wait(). The prototype worked, so I put together a small project. When I ran tox and realized that this issue with wait_for is only present on py38 and py39 (possibly py310). The wait_for does not get stuck with py36, py37 and pypy3.

The repo is a little bare bones, but you can run tox after checkout: https://github.com/Traktormaster/wait-for2

Right now the tests are set-up that they expect wait_for to get stuck so only py38 and py39 passes.

I'm pretty sure the side-effect of returning the future's result when handling cancellation is not desired. However I'm not sure how to handle it correctly. The repo holds a demo of what I suggested in the beginning of this thread (CancelledWithResultError). It works but it is limited.
History
Date User Action Args
2021-03-03 21:18:09nmatravolgyisetrecipients: + nmatravolgyi, asvetlov, yselivanov
2021-03-03 21:18:09nmatravolgyisetmessageid: <1614806289.45.0.299347842878.issue43389@roundup.psfhosted.org>
2021-03-03 21:18:09nmatravolgyilinkissue43389 messages
2021-03-03 21:18:09nmatravolgyicreate