code: def write(self, data, sections=None):
          
  
          if self.error[0]:
              self.status = self.error[0]
              data = b(self.error[1])
  
          if not self.headers_sent:
              self.send_headers(data, sections)
  
          if self.request_method != 'HEAD':
              try:
                  if self.chunked:
                      self.conn.sendall(b('%x\r\n%s\r\n' % (len(data), data)))
                  else:
                      self.conn.sendall(data)
              except socket.timeout:
                  self.closeConnection = True
              except socket.error:
                  # But some clients will close the connection before that
                  # resulting in a socket error.
                  self.closeConnection = True
docs: Write the data to the output socket.