def make_str(value):
 if isinstance(value, bytes):
  try:
   return value.decode(get_filesystem_encoding())
  except UnicodeError:
   return value.decode('utf-8', 'replace')
 return text_type(value)

def make_str ( value ) : if isinstance ( value , bytes ) : try : return value . decode ( get_filesystem_encoding ( ) ) except UnicodeError : return value . decode ( 'utf-8' , 'replace' ) return text_type ( value )
converts a value into a valid string .