[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: You can use try/except in handler() and dispatch the exception whatever you want. It doesn't require a new asyncio version, debug-only flag, etc. -- ___ Python tracker

[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Tom
Tom added the comment: How do you suggest one might test code in a Server callback with asyncio? Of course, I don't want any old exception to affect another client connection, only an exception which is uncaught up to the handler coro. And I'm not suggesting that it happen by default, only

[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: This is a deliberate decision. An exception in handling one client connection should not break another connected client. -- ___ Python tracker

[issue42526] Exceptions in asyncio.Server callbacks are not retrievable

2020-12-01 Thread Tom
New submission from Tom : Consider this program: import asyncio async def handler(r, w): raise RuntimeError async def main(): server = await asyncio.start_server(handler, host='localhost', port=1234) r, w = await asyncio.open_connection(host='localhost',