[New-bugs-announce] [issue41891] asyncio.wait_for does not wait for task/future to be completed in all cases

Richard Kojedzinszky report at bugs.python.org
Wed Sep 30 07:01:52 EDT 2020


New submission from Richard Kojedzinszky <richard at kojedz.in>:

This code should run without errors:

```
#!/usr/bin/env python

import asyncio

async def task1():
    cv = asyncio.Condition()

    async with cv:
        await asyncio.wait_for(cv.wait(), 10)

async def main(loop):
    task = loop.create_task(task1())

    await asyncio.sleep(0)

    task.cancel()

    res = await asyncio.wait({task})

if __name__ == '__main__':
    loop = asyncio.get_event_loop()

    loop.run_until_complete(main(loop))
```

----------
components: asyncio
messages: 377695
nosy: asvetlov, rkojedzinszky, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait_for does not wait for task/future to be completed in all cases
type: behavior
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41891>
_______________________________________


More information about the New-bugs-announce mailing list