          encoder = MessageEncoder(separators=(',', ':'))
          return encoder.encode(messages)
  
      def deserialize_messages(self, data):
          if data and isinstance(data, six.string_types):
              return json.loads(data, cls=MessageDecoder)
          return data
 
</s> remove         if isinstance(data, six.string_types):
 </s> add         if isinstance(data, str): </s> remove         return six.text_type(self.name)
 </s> add         return self.name </s> remove 

def to_unicode(s):
    """
    Convert strings to Unicode objects (and return all other data types
    unchanged).
    """
    if isinstance(s, six.string_types):
        return force_text(s)
    return s
 </s> add  </s> remove         return six.text_type(self.name)
 </s> add         return self.name </s> remove         if isinstance(value, six.text_type):
            return six.memoryview(b64decode(force_bytes(value)))
 </s> add         if isinstance(value, str):
            return memoryview(b64decode(force_bytes(value)))
        if data and isinstance(data, str):
          encoder = MessageEncoder(separators=(',', ':'))
          return encoder.encode(messages)
  
      def deserialize_messages(self, data):
        if data and isinstance(data, str):
              return json.loads(data, cls=MessageDecoder)
          return data
keep keep keep keep replace keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/contrib/messages/storage/session.py