              pass
  
          try:
              meta = parser_context['request'].META
              disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode('utf-8'))
              filename_parm = disposition[1]
              if 'filename*' in filename_parm:
                  return self.get_encoded_filename(filename_parm)
              return force_text(filename_parm['filename'])
          except (AttributeError, KeyError, ValueError):
 
</s> remove                     data = data.decode('utf-8')
 </s> add                     data = data.decode() </s> remove             # On python 2.x the return type for json.dumps() is underspecified.
            # On python 3.x json.dumps() returns unicode strings.
            if isinstance(value, str):
                value = bytes(value.encode('utf-8'))
 </s> add             value = value.encode() </s> remove         return yaml.dump(structure, default_flow_style=False).encode('utf-8')
 </s> add         return yaml.dump(structure, default_flow_style=False).encode() </s> remove         # On python 2.x json.dumps() returns bytestrings if ensure_ascii=True,
        # but if ensure_ascii=False, the return type is underspecified,
        # and may (or may not) be unicode.
        # On python 3.x json.dumps() returns unicode strings.
        if isinstance(ret, str):
            # We always fully escape \u2028 and \u2029 to ensure we output JSON
            # that is a strict javascript subset. If bytes were returned
            # by json.dumps() then we don't have these characters in any case.
            # See: http://timelessrepo.com/json-isnt-a-javascript-subset
            ret = ret.replace('\u2028', '\\u2028').replace('\u2029', '\\u2029')
            return bytes(ret.encode('utf-8'))
        return ret
 </s> add         # We always fully escape \u2028 and \u2029 to ensure we output JSON
        # that is a strict javascript subset.
        # See: http://timelessrepo.com/json-isnt-a-javascript-subset
        ret = ret.replace('\u2028', '\\u2028').replace('\u2029', '\\u2029')
        return ret.encode() </s> remove         return json.dumps(structure, indent=4).encode('utf-8')
 </s> add         return json.dumps(structure, indent=4).encode()
            disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode())
              pass
  
          try:
              meta = parser_context['request'].META
            disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode())
              filename_parm = disposition[1]
              if 'filename*' in filename_parm:
                  return self.get_encoded_filename(filename_parm)
              return force_text(filename_parm['filename'])
          except (AttributeError, KeyError, ValueError):
keep keep keep keep replace keep keep keep keep keep
 Drop default 'utf-8' to .encode()/.decode() (#6633)

A Python 3 cleanup that allows for less noise in the code.

https://docs.python.org/3/library/stdtypes.html#bytes.decode
https://docs.python.org/3/library/stdtypes.html#str.encode 
rest_framework/parsers.py