- 
                Notifications
    
You must be signed in to change notification settings  - Fork 17
 
Description
Placeholder for now, until I can come up with a minimum reproducible example.
Not sure if this belongs here, or in circuitpython.
Occurs in 7.3.3 and 8.0.0-beta.5.
Basic scenario:
async def foo(interval1):
     print("A")
     # some_statement_that_produces_a_caught_exception()
     print("B")
     await asyncio.sleep(interval1)
async def bar(interval2):
     print("C")
     print("D")
     await asyncio.sleep(interval2)Output:
A
C
D
# traceback.print_exception(None, exc, exc.__traceback__) from library
B (??)
It seems to occur when the exception is caught by the library-internal exception handler, rather than when the exception is caught by user code.
edited to reflect additional testing
So maybe this is intended behavior? It was confusing that the exceptioned-task was interrupted, but the exception wasn't printed until after other tasks had run. I thought I had a case where print("B") would show up later after the library traceback, but now I'm not sure.
Addendum: When the library catches routine development bugs like this (syntax errors, type errors), but everything continues to operate, it can mask problems with the user code.