          self.max_length = kwargs.pop('max_length', None)
          self.allow_empty_file = kwargs.pop('allow_empty_file', False)
          if 'use_url' in kwargs:
              self.use_url = kwargs.pop('use_url')
          super(FileField, self).__init__(*args, **kwargs)
  
      def to_internal_value(self, data):
          try:
              # `UploadedFile` objects should have name and size attributes.
              file_name = data.name
 
</s> remove         super(CharField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove                 self.error_messages['max_length'].format,
                six.text_type)(max_length=self.max_length)
 </s> add                 self.error_messages['max_length'].format, str)(max_length=self.max_length) </s> remove         super(_UnvalidatedField, self).__init__(*args, **kwargs)
 </s> add         super().__init__(*args, **kwargs) </s> remove         super(DefaultRouter, self).__init__(*args, **kwargs)
 </s> add         super().__init__(*args, **kwargs) </s> remove                 kwargs = super(NestedPointSerializer, self).to_internal_value(data)
 </s> add                 kwargs = super().to_internal_value(data)
        super().__init__(*args, **kwargs)
          self.max_length = kwargs.pop('max_length', None)
          self.allow_empty_file = kwargs.pop('allow_empty_file', False)
          if 'use_url' in kwargs:
              self.use_url = kwargs.pop('use_url')
        super().__init__(*args, **kwargs)
  
      def to_internal_value(self, data):
          try:
              # `UploadedFile` objects should have name and size attributes.
              file_name = data.name
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