asyncio does not always show the full traceback

dieter dieter at handshake.de
Wed Mar 1 01:28:29 EST 2017


"Frank Millman" <frank at chagford.com> writes:
> I use asyncio in my project, so most of my functions start with
> 'async' and most of my calls are preceded by 'await'.
>
> If an exception is raised, I usually get the full traceback, but
> sometimes I just get something like the following -
>
> Traceback (most recent call last):
>  File "C:\Users\User\aib\aib\test_data.py", line 645, in <module>
>    loop.run_until_complete(main(company))
>  File
> "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\asyncio\base_events.py",
> line 466, in run_until_complete
>    return future.result()
> ValueError: not enough values to unpack (expected 2, got 1)
>
> It does not show the line where the ValueError occurs, and I have not
> managed to narrow down exactly when this happens.

Not sure whether this applies to your case: things like your observation
are common when C level code is involved. C level code does not
have line numbers (Python knows about). Therefore, you get the exception
but the traceback only covers the Python code path.




More information about the Python-list mailing list