code: def str2fp(data):
      
      return BytesIO(bytearray(data, const.ENCODING)) if const.PY3 else StringIO(data)
docs: Convert bytes data to file handle object (StringIO or BytesIO).
  
      :arg data: String data to transform