code: def write_longstr(self, s):
          
          self._flushbits()
          if isinstance(s, text_t):
              s = s.encode('utf-8')
          self.write_long(len(s))
          self.out.write(s)
docs: Write a string up to 2**32 bytes long after encoding.
  
          If passed a unicode string, encode as UTF-8.