Fix a bug that causes unicode error.

How to reproduce:
Calling logging.exception('…'), and sys.exc_info() contains non-ascii charachers.