[issue26923] asyncio.gather drops cancellation

Guido van Rossum report at bugs.python.org
Fri Jun 17 17:40:05 EDT 2016


Guido van Rossum added the comment:

Thanks! I had eventually pieced together the same explanation. So yes, I
think your fix is right, though I would write it like this:

        ret = False
        for child in self._children:
            ret |= child.cancel()
        return ret  # True if at least one child.cancel() call returned True

It would also be nice if there was a test for this behavior.

I keep worrying a bit -- a similar bug could exist in other pieces of the
code, or in other libraries. But I guess we can't do much about that.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26923>
_______________________________________


More information about the Python-bugs-list mailing list