  
      If use_l10n is provided and is not None, that will force the value to
      be localized (or not), overriding the value of settings.USE_L10N.
      """
      if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
          return value
      elif isinstance(value, bool):  # Make sure booleans don't get treated as numbers
          return mark_safe(six.text_type(value))
      elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
          return number_format(value, use_l10n=use_l10n)
 
</s> remove         return mark_safe(six.text_type(value))
    elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
 </s> add         return mark_safe(str(value))
    elif isinstance(value, (decimal.Decimal, float, int)): </s> remove     if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
 </s> add     if isinstance(value, str):  # Handle strings first for performance reasons. </s> remove         return six.text_type(value)
    elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
 </s> add         return str(value)
    elif isinstance(value, (decimal.Decimal, float, int)): </s> remove         elif f.geom_type == 'RASTER' and isinstance(value, six.string_types):
 </s> add         elif f.geom_type == 'RASTER' and isinstance(value, str): </s> remove     if issubclass(type(s), six.text_type):
 </s> add     if issubclass(type(s), str):
    if isinstance(value, str):  # Handle strings first for performance reasons.
  
      If use_l10n is provided and is not None, that will force the value to
      be localized (or not), overriding the value of settings.USE_L10N.
      """
    if isinstance(value, str):  # Handle strings first for performance reasons.
          return value
      elif isinstance(value, bool):  # Make sure booleans don't get treated as numbers
          return mark_safe(six.text_type(value))
      elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
          return number_format(value, use_l10n=use_l10n)
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/utils/formats.py