  
          # Get a clone of the field with text-only value representation.
          field = field.as_form_field()
  
          if style.get('input_type') == 'datetime-local' and isinstance(field.value, six.text_type):
              field.value = field.value.rstrip('Z')
  
          if 'template' in style:
              template_name = style['template']
          else:
 
</s> remove             if isinstance(value, six.text_type):
 </s> add             if isinstance(value, str): </s> remove     value = unicode_repr(value)
 </s> add     value = repr(value) </s> remove         ret = super(Serializer, self).errors
 </s> add         ret = super().errors </s> remove         ret = super(ListSerializer, self).errors
 </s> add         ret = super().errors </s> remove         if value is None or value is '':
 </s> add         if value is None or value == '':
        if style.get('input_type') == 'datetime-local' and isinstance(field.value, str):
  
          # Get a clone of the field with text-only value representation.
          field = field.as_form_field()
  
        if style.get('input_type') == 'datetime-local' and isinstance(field.value, str):
              field.value = field.value.rstrip('Z')
  
          if 'template' in style:
              template_name = style['template']
          else:
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/renderers.py