When I try to log a captured EDAMUserException using the python standard logging system, the logging system raises a new exception because is unable to handle EDAMUserException.
Internally the logging system is calling traceback to print the exception, but traceback fails.
This is the line of code that generates the exception when printing EDAMUserException.
traceback.print_exception(ei[0], ei[1], tb, None, sio)
I also attach a related traceback.
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:1310: in exception
self.error(msg, _args, *_kwargs)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:1303: in error
self._log(ERROR, msg, args, **kwargs)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:1409: in _log
self.handle(record)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:1419: in handle
self.callHandlers(record)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:1481: in callHandlers
hdlr.handle(record)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:853: in handle
self.emit(record)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:1041: in emit
StreamHandler.emit(self, record)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:984: in emit
self.handleError(record)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/init.py:906: in handleError
traceback.print_exception(t, v, tb, None, sys.stderr)
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:169: in print_exception
for line in _format_exception_iter(etype, value, tb, limit, chain):
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:146: in _format_exception_iter
for value, tb in values:
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:138: in _iter_chain
yield from it
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:138: in _iter_chain
yield from it
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:138: in _iter_chain
yield from it
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:138: in _iter_chain
yield from it
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:138: in _iter_chain
yield from it
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:138: in _iter_chain
yield from it
exc = TypeError("unhashable type: 'EDAMUserException'",), custom_tb = None
seen = set([TypeError("unhashable type: 'EDAMUserException'",), TypeError("unhashable type: 'EDAMUserException'",), TypeError...tion'",), TypeError("unhashable type: 'EDAMUserException'",), TypeError("unhashable type: 'EDAMUserException'",), ...])
def _iter_chain(exc, custom_tb=None, seen=None):
if seen is None:
seen = set()
seen.add(exc)
its = []
context = exc.__context__
cause = exc.__cause__
if cause is not None and cause not in seen:
its.append(_iter_chain(cause, False, seen))
its.append([(_cause_message, None)])
elif (context is not None and
not exc.__suppress_context__ and
E TypeError: unhashable type: 'EDAMUserException'
/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py:132: TypeError