[python-tulip] Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread hilo jack
# python >= 3.5.0 import asyncio import time from os.path import exists import logging import logging.config conf = ''' [loggers] keys=root [logger_root] level=DEBUG handlers=hand01 [handlers] keys=hand01 [handler_hand01] class=StreamHandler args=(sys.stdout,) formatter=form01 [formatters]

Re: [python-tulip] Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread Martin Richard
Hi, I think that when you configure the logging, the exception is logged when the program terminates as the exception was never retrieved explicitly. When you don't configure the logging system, the exception is still logged, but not printed as the logger is not told to do so. wait() returns a pa

Re: [python-tulip] Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread hilo jack
In fact, my logger will not catch any exception. 1. When I configure the logging, *the exception is not logged* when the program terminates, and *the uncatched exception won't be printed on the screen* 2. When I don't configure the logging system,* the exception is still not log

[python-tulip] Re: Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread hilo jack
done, pending = asyncio.get_event_loop().run_until_complete(asyncio.wait([ sync()])) # terminated here print(pending) for task in done: done.result() # it will not raise the exception

[python-tulip] Re: Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread 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_compl

Re: [python-tulip] Re: Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread Martin Richard
done.result() should raise an AttributeError (as you should have wrote task.result()). 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.

Re: [python-tulip] Re: Why asyncio does not raise up exception when using `logging.config.fileConfig`

2016-09-19 Thread hilo jack
You are right, I'll try to figure out the mistake in my configuration of logging system in my spare time. Many thanks! On Monday, September 19, 2016 at 7:24:19 PM UTC+8, Martin Richard wrote: > > done.result() should raise an AttributeError (as you should have wrote > task.result()). > When the