done.result() should raise an AttributeError (as you should have wrote
When the logger is disabled, task.result() raise the exception.

The mistake is somewhere in your configuration of the logging system: it
suppresses the output of the exception.
For instance, when I call logging.error("test log") instead of
fileConfig(), the output is:

    No exception raise
    ERROR:asyncio:Task exception was never retrieved
    future: <Task finished coro=<sync() done, defined at>
exception=NameError("name 'undefined' is not defined",) created at
    source_traceback: Object created at (most recent call last):

Which shows that the exception is indeed logged.

2016-09-19 13:16 GMT+02:00 hilo jack <>:

> done, pending = asyncio.get_event_loop().run_until_complete(asyncio.wait([
> sync(), sync()])) # terminated here
> print(pending)
> for task in done:
>      done.result()  # it will not raise the exception
> To get exceptions, I use asyncio.gather(*tasks) instead.
> asyncio.get_event_loop().run_until_complete(asyncio.gather(*[sync(), sync
> ()])) #  it will  raise  exception

Martin <> Richard

Reply via email to