Currently, importing enable.api changes logging configuration in a fun way, modifying the type of Logger objects and setting a "handler of last resort":
>>> import logging
>>> logging.lastResort
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'lastResort'
>>> logging.getLogger("as.expected")
<logging.Logger object at 0x10062b550>
>>> import enable.api
>>> logging.lastResort
<fontTools.misc.py23._StderrHandler object at 0x10aedbdd0>
>>> logging.getLogger("not.as.expected")
<fontTools.misc.py23._Logger object at 0x123106f50>
This isn't caused directly by enable. The configuration is coming from fontTools: see fonttools/fonttools#1277. However, it's possible that until/unless it's fixed in fontTools, we might want to work around it in enable by setting logging.lastResort to None if the attribute is not defined, before any fontTools import takes place.
Currently, importing
enable.apichanges logging configuration in a fun way, modifying the type ofLoggerobjects and setting a "handler of last resort":This isn't caused directly by enable. The configuration is coming from fontTools: see fonttools/fonttools#1277. However, it's possible that until/unless it's fixed in
fontTools, we might want to work around it inenableby settinglogging.lastResorttoNoneif the attribute is not defined, before anyfontToolsimport takes place.