Xavier de Gaye added the comment:
Thanks Xavier for the bug report, it should now be fixed.
Works fine with me. Thanks for the patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23140
STINNER Victor added the comment:
Oh no. My comment was not published, it was probably an issue with my unstable
Internet connection.
Here is a patch fixing the issue with an unit test.
There is another call to Future.set_result() in subprocess.py not protected by
an if in connection_made().
Guido van Rossum added the comment:
The patch looks good, although the test feels overly complex (but maybe I'm
missing something).
I'm okay with leaving the other unguarded set_result() call unchanged, but I'm
also okay with putting if not self.waiter.cancelled(): around it.
--
STINNER Victor added the comment:
Thanks Xavier for the bug report, it should now be fixed.
Sorry, I don't see any workaround right now (except of using the development
version of Tulip).
The patch looks good, although the test feels overly complex (but maybe I'm
missing something).
Oh, I
Roundup Robot added the comment:
New changeset 990ce80d8283 by Victor Stinner in branch '3.4':
Issue #23140, asyncio: Simplify the unit test
https://hg.python.org/cpython/rev/990ce80d8283
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
I'm okay with leaving the other unguarded set_result() call unchanged, but
I'm also okay with putting if not self.waiter.cancelled(): around it.
While playing with asyncio to try to inject errors on this code path, I found
even more severe issues: see the
Roundup Robot added the comment:
New changeset 7c9b9d2514bb by Victor Stinner in branch '3.4':
Issue #23140, asyncio: Fix cancellation of Process.wait(). Check the state of
https://hg.python.org/cpython/rev/7c9b9d2514bb
--
nosy: +python-dev
___
Xavier de Gaye added the comment:
The exception is not raised when loop.set_debug(False) on my linux box.
So I guess this may be not reproductible on all platforms.
The new attached test_cancel_2.py raises an exception while asyncio debug is
false, by forcing one more iteration of the loop
New submission from Xavier de Gaye:
The attached test_cancel.py script prints the following error:
Exception in callback SubprocessStreamProtocol.process_exited()
handle: Handle SubprocessStreamProtocol.process_exited() created at
Lib/asyncio/base_subprocess.py:130
source_traceback: Object