Fixing UnicodeDecodeError when traceback contains unicode characters