Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

This issue was just resolved by the combination of #40607 followed by #31033 
(merged for 3.9.0 beta 1).

Running the example code above now results in the following:

Traceback (most recent call last):
  File "/.../cpython/test-31131.py", line 5, in run
    await asyncio.sleep(1000000)
  File "/.../cpython/Lib/asyncio/tasks.py", line 669, in sleep
    return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../cpython/Lib/asyncio/tasks.py", line 507, in wait_for
    fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/.../cpython/test-31131.py", line 15, in <module>
    main(run())
  File "/.../cpython/test-31131.py", line 11, in main
    loop.run_until_complete(future)
  File "/.../cpython/Lib/asyncio/base_events.py", line 642, in 
run_until_complete
    return future.result()
  File "/.../cpython/Lib/asyncio/tasks.py", line 509, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

As you can see the traceback now includes the exception chain from the 
TimeoutError to the point of interruption: await asyncio.sleep(1000000).

----------
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Improve traceback of cancelled tasks / add cancel() msg argument
versions: +Python 3.9 -Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31131>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to