This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients asvetlov, bjs, chris.jerdonek, graingert, gvanrossum, pagliaricci.m, serhiy.storchaka, yselivanov
Date 2022-02-23.14:56:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645628187.76.0.255518188516.issue45390@roundup.psfhosted.org>
In-reply-to
Content
For future reference, with Andrew's change merged above, the traceback for the example snippet in my message above:
https://bugs.python.org/issue45390#msg403570
is now the following. Observe that (1) the call to sleep() continues to be present, but (2) without introducing two new intermediate CancelledErrors, which increase the verbosity of the traceback:

Traceback (most recent call last):
  File "/home/andrew/projects/cpython/exc_traceback.py", line 14, in <module>
    asyncio.run(main())
    ^^^^^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/Lib/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/Lib/asyncio/base_events.py", line 640, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/exc_traceback.py", line 11, in main
    await task
    ^^^^^^^^^^
  File "/home/andrew/projects/cpython/exc_traceback.py", line 5, in job
    await asyncio.sleep(5)
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/Lib/asyncio/tasks.py", line 619, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError: cancel job

(This is copied from Andrew's comment in the PR here:
https://github.com/python/cpython/pull/31383#issuecomment-1046822899 )

Serhiy, can you provide a sample snippet for your case with output, like I did in my message linked above?
History
Date User Action Args
2022-02-23 14:56:27chris.jerdoneksetrecipients: + chris.jerdonek, gvanrossum, asvetlov, serhiy.storchaka, yselivanov, graingert, bjs, pagliaricci.m
2022-02-23 14:56:27chris.jerdoneksetmessageid: <1645628187.76.0.255518188516.issue45390@roundup.psfhosted.org>
2022-02-23 14:56:27chris.jerdoneklinkissue45390 messages
2022-02-23 14:56:27chris.jerdonekcreate