          else:
              return s.decode('utf-8', errors).encode(encoding, errors)
      if strings_only and is_protected_type(s):
          return s
      if isinstance(s, six.memoryview):
          return bytes(s)
      if isinstance(s, Promise):
          return six.text_type(s).encode(encoding, errors)
      if not isinstance(s, six.string_types):
          try:
 
</s> remove         return six.text_type(s).encode(encoding, errors)
    if not isinstance(s, six.string_types):
 </s> add         return str(s).encode(encoding, errors)
    if not isinstance(s, str): </s> remove         if not issubclass(type(s), six.string_types):
 </s> add         if not issubclass(type(s), str): </s> remove             return six.text_type(s).encode(encoding)
 </s> add             return str(s).encode(encoding) </s> remove                 s = six.text_type(s, encoding, errors)
 </s> add                 s = str(s, encoding, errors) </s> remove                 s = six.text_type(s)
 </s> add                 s = str(s)
    if isinstance(s, memoryview):
          else:
              return s.decode('utf-8', errors).encode(encoding, errors)
      if strings_only and is_protected_type(s):
          return s
    if isinstance(s, memoryview):
          return bytes(s)
      if isinstance(s, Promise):
          return six.text_type(s).encode(encoding, errors)
      if not isinstance(s, six.string_types):
          try:
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/encoding.py