              self.fail('incorrect_type', data_type=type(data).__name__)
  
          if http_prefix:
              # If needed convert absolute URLs to relative path
              data = urlparse.urlparse(data).path
              prefix = get_script_prefix()
              if data.startswith(prefix):
                  data = '/' + data[len(prefix):]
  
          data = uri_to_iri(data)
 
</s> remove         return super(RelatedField, self).run_validation(data)
 </s> add         return super().run_validation(data) </s> remove             if six.PY3:
                query_string = query_string.decode('iso-8859-1')
 </s> add             query_string = query_string.decode('iso-8859-1') </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         super(BaseSerializer, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs)
            data = parse.urlparse(data).path
              self.fail('incorrect_type', data_type=type(data).__name__)
  
          if http_prefix:
              # If needed convert absolute URLs to relative path
            data = parse.urlparse(data).path
              prefix = get_script_prefix()
              if data.startswith(prefix):
                  data = '/' + data[len(prefix):]
  
          data = uri_to_iri(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/relations.py