[issue21596] asyncio.wait fails when futures list is empty

New submission from Sebastian Kreft: Passing an empty list/set of futures to asyncio.wait raises an Exception, which is a little annoying in some use cases. Probably this was the intended behavior as I see there's a test case for that. If such, then I would propose to document that behavior. ---------- assignee: docs@python components: Documentation messages: 219290 nosy: Sebastian.Kreft.Deezer, docs@python priority: normal severity: normal status: open title: asyncio.wait fails when futures list is empty versions: Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21596> _______________________________________

Changes by STINNER Victor <victor.stinner@gmail.com>: ---------- nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21596> _______________________________________

Changes by STINNER Victor <victor.stinner@gmail.com>: ---------- components: +Asyncio _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21596> _______________________________________

STINNER Victor added the comment:
Probably this was the intended behavior as I see there's a test case for that. If such, then I would propose to document that behavior.
The code has an explicit check: if not fs: raise ValueError('Set of coroutines/Futures is empty.') And yes, the behaviour is tested by test_asyncio. Attached patch changes mention this behaviour in the documentation. Does it look correct? ---------- keywords: +patch Added file: http://bugs.python.org/file35496/wait_doc.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21596> _______________________________________

Sebastian Kreft added the comment: LGTM. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21596> _______________________________________

Roundup Robot added the comment: New changeset 2b3f8b6d6e5c by Victor Stinner in branch '3.4': Issue #21596: asyncio.wait(): mention that the sequence of futures must not http://hg.python.org/cpython/rev/2b3f8b6d6e5c New changeset 68d45a1a3ce0 by Victor Stinner in branch 'default': (Merge 3.4) Issue #21596: asyncio.wait(): mention that the sequence of futures http://hg.python.org/cpython/rev/68d45a1a3ce0 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21596> _______________________________________

STINNER Victor added the comment: Fixed. Thanks for the report. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21596> _______________________________________

Change by Joel Rosdahl <joel@rosdahl.net>: ---------- nosy: +jrosdahl nosy_count: 8.0 -> 9.0 pull_requests: +19212 pull_request: https://github.com/python/cpython/pull/19900 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue21596> _______________________________________

Change by STINNER Victor <vstinner@python.org>: ---------- nosy: -vstinner _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue21596> _______________________________________

Guido van Rossum <guido@python.org> added the comment: New changeset 9d74658f0a6e8a9b8d6dcf199dda886f35c6ad68 by Joel Rosdahl in branch 'master': bpo-40499: Mention that asyncio.wait() needs a non-empty aws set (GH-19900) https://github.com/python/cpython/commit/9d74658f0a6e8a9b8d6dcf199dda886f35c... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue21596> _______________________________________
participants (5)
-
Guido van Rossum
-
Joel Rosdahl
-
Roundup Robot
-
Sebastian Kreft
-
STINNER Victor