asyncio does not always show the full traceback

Chris Angelico rosuav at gmail.com
Thu Mar 2 08:06:15 EST 2017


On Thu, Mar 2, 2017 at 11:55 PM, Frank Millman <frank at chagford.com> wrote:
> If I place '1/0' in main(), this is the traceback -
>
> Traceback (most recent call last):
>  File "test_db1a.py", line 25, in <module>
>    loop.run_until_complete(main())
>  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 466, in
> run_until_complete
>    return future.result()
> ZeroDivisionError: division by zero
>
> Can anyone else confirm whether they can reproduce my results?

Not replicated.

Python 3.7.0a0 (default:cebc9c7ad195+, Feb 28 2017, 01:09:27)
[GCC 6.2.0 20161027] on linux

Traceback (most recent call last):
  File "acrash.py", line 25, in <module>
    loop.run_until_complete(main())
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 465, in
run_until_complete
    return future.result()
  File "acrash.py", line 21, in main
    1/0
ZeroDivisionError: division by zero

That's inserting 1/0 just before "await aenum()". Switching the order
of the lines also produces the expected result - delayed output, then
an exception that shows the crashing line.

ChrisA



More information about the Python-list mailing list