      def run_validation(self, data=empty):
          # Test for the empty string here so that it does not get validated,
          # and so that subclasses do not need to handle it explicitly
          # inside the `to_internal_value()` method.
          if data == '' or (self.trim_whitespace and six.text_type(data).strip() == ''):
              if not self.allow_blank:
                  self.fail('blank')
              return ''
          return super(CharField, self).run_validation(data)
  
 
</s> remove         return super(RelatedField, self).run_validation(data)
 </s> add         return super().run_validation(data) </s> remove class ViewSetMixin(object):
 </s> add class ViewSetMixin: </s> remove # -- coding: utf-8 --

 </s> add  </s> remove def unicode_repr(instance):
    # Get the repr of an instance, but ensure it is a unicode string
    # on both python 3 (already the case) and 2 (not the case).
    if six.PY2:
        return repr(instance).decode('utf-8')
    return repr(instance)


def unicode_to_repr(value):
    # Coerce a unicode string to the correct repr return type, depending on
    # the Python version. We wrap all our `__repr__` implementations with
    # this and then use unicode throughout internally.
    if six.PY2:
        return value.encode('utf-8')
    return value


 </s> add  </s> remove         super(SimpleRouter, self).__init__()
 </s> add         super().__init__()
        if data == '' or (self.trim_whitespace and str(data).strip() == ''):
      def run_validation(self, data=empty):
          # Test for the empty string here so that it does not get validated,
          # and so that subclasses do not need to handle it explicitly
          # inside the `to_internal_value()` method.
        if data == '' or (self.trim_whitespace and str(data).strip() == ''):
              if not self.allow_blank:
                  self.fail('blank')
              return ''
          return super(CharField, self).run_validation(data)
  
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/fields.py