title: Python logging special characters to file throws exception
body: <p>I have a logger which logs to file but occasionally when it encounters TM characters it throws an exception and the entry is not logged.</p>
  
  <pre><code>logging.basicConfig(filename='C:/Users/Administrator/Desktop/logs/log.log',
      level=logging.INFO, 
      format='%(asctime)s - %(message)s') 
  </code></pre>
  
  <p>What's wrong with it?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Those are time and message obviously. The message is being received from google chrome via websocket as a stringified object {log: log} which is then parsed using data=json.loads(obj). Then data["log"] string goes into message.</p>