def doGetOrHead(self, handler, path, write_content):
        response = None
        file_path = conf.supybot.servers.http.favicon()
        if file_path:
            try:
                icon = open(file_path, 'rb')
                response = icon.read()
            except __HOLE__:
                pass
            finally:
                icon.close()
        if response is not None:
            # I have no idea why, but this headers are already sent.
            # filename = file_path.rsplit(os.sep, 1)[1]
            # if '.' in filename:
            #     ext = filename.rsplit('.', 1)[1]
            # else:
            #     ext = 'ico'
            # self.send_header('Content-Length', len(response))
            # self.send_header('Content-type', 'image/' + ext)
            # self.end_headers()
            if write_content:
                self.wfile.write(response)
        else:
            response = _('No favicon set.')
            if minisix.PY3:
                response = response.encode()
            handler.send_response(404)
            self.send_header('Content-type', 'text/plain; charset=utf-8')
            self.send_header('Content-Length', len(response))
            self.end_headers()
            if write_content:
                self.wfile.write(response)
dataset/ETHPy150Open ProgVal/Limnoria/src/httpserver.py/Favicon.doGetOrHead