UnicodeDecodeError when logging an Exception in Python
问题 I'm using Python 2.7.9. x32 on Win7 x64. When I'm logging an Exception containing Umlauts, I always receive UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 39: ordinal not in range(128) My example code is: except Exception as e: logging.error('Error loading SCMTool for repository ' '%s (ID %d): %s' % (repo.name, repo.id, e), exc_info=1) The Exception being logged is WindowsError: [Error 267] Der Verzeichnisname ist ungültig . The Problem is based on the "ung Ü ltig"