Issue 44815: asyncio.gather no DeprecationWarning if task are passed
Issue44815
Created on 2021-08-02 18:29 by dreamsorcerer, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 27568 | closed | dreamsorcerer, 2021-08-02 18:35 | |
| PR 27569 | merged | dreamsorcerer, 2021-08-02 21:21 | |
| Messages (5) | |||
|---|---|---|---|
| msg398794 - (view) | Author: Sam Bull (dreamsorcerer) * | Date: 2021-08-02 18:29 | |
When calling asyncio.gather() a DeprecationWarning is only emitted if no tasks are passed (which is probably the exceptional case, rather than the standard one). This has resulted in us missing this deprecated argument in aiohttp until we received a bug report from a user trying it out against the 3.10 beta. For some reason the warning only appears under a `if not coros_or_futures:` block. I think it should be run regardless: https://github.com/python/cpython/blob/3.9/Lib/asyncio/tasks.py#L757 |
|||
| msg398797 - (view) | Author: Sam Bull (dreamsorcerer) * | Date: 2021-08-02 18:55 | |
There is another issue with asyncio.sleep() too, if the passed argument is 0. This also tripped up the tests in aiohttp (though I've also used an explicit 0 in production code to yield back to the loop). |
|||
| msg399862 - (view) | Author: Łukasz Langa (lukasz.langa) * ![]() |
Date: 2021-08-18 18:48 | |
New changeset b2779b2aa16acb3fd1297ccfe2fe5aaa007f74ae by Sam Bull in branch '3.9': [3.9] bpo-44815: Always show deprecation in asyncio.gather/sleep() (GH-27569) https://github.com/python/cpython/commit/b2779b2aa16acb3fd1297ccfe2fe5aaa007f74ae |
|||
| msg399864 - (view) | Author: Łukasz Langa (lukasz.langa) * ![]() |
Date: 2021-08-18 18:58 | |
Thanks, Sam! ✨ 🍰 ✨ |
|||
| msg401033 - (view) | Author: (yan12125) * | Date: 2021-09-04 02:42 | |
A regression in 3.9.7 (issue45097) seems related to this issue. Could you have a look? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:48 | admin | set | github: 88978 |
| 2021-09-04 02:42:34 | yan12125 | set | nosy:
+ yan12125 messages: + msg401033 |
| 2021-08-18 18:58:54 | lukasz.langa | set | status: open -> closed resolution: fixed messages: + msg399864 stage: patch review -> resolved |
| 2021-08-18 18:48:10 | lukasz.langa | set | nosy:
+ lukasz.langa messages: + msg399862 |
| 2021-08-02 21:21:36 | dreamsorcerer | set | pull_requests: + pull_request26076 |
| 2021-08-02 18:55:21 | dreamsorcerer | set | messages: + msg398797 |
| 2021-08-02 18:35:42 | dreamsorcerer | set | keywords:
+ patch stage: patch review pull_requests: + pull_request26075 |
| 2021-08-02 18:29:57 | dreamsorcerer | create | |
