classification
Title: asyncio.gather no DeprecationWarning if task are passed
Type: Stage: resolved
Components: asyncio Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, dreamsorcerer, lukasz.langa, yan12125, yselivanov
Priority: normal Keywords: patch

Created on 2021-08-02 18:29 by dreamsorcerer, last changed 2021-09-04 02:42 by yan12125. 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) * (Python committer) 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) * (Python committer) Date: 2021-08-18 18:58
Thanks, Sam! ✨ 🍰 ✨
msg401033 - (view) Author: Chih-Hsuan Yen (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
2021-09-04 02:42:34yan12125setnosy: + yan12125
messages: + msg401033
2021-08-18 18:58:54lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg399864

stage: patch review -> resolved
2021-08-18 18:48:10lukasz.langasetnosy: + lukasz.langa
messages: + msg399862
2021-08-02 21:21:36dreamsorcerersetpull_requests: + pull_request26076
2021-08-02 18:55:21dreamsorcerersetmessages: + msg398797
2021-08-02 18:35:42dreamsorcerersetkeywords: + patch
stage: patch review
pull_requests: + pull_request26075
2021-08-02 18:29:57dreamsorcerercreate