

def handle_line(self, line):
    try:
        req = WSGIRequest(line)
        response = self.app(req.read(), req.start_response)
    except:
        self.send_response(500, ''.join(traceback.format_exc()), {
            'Content-Type': 'text/plain',
        })
        return
    content = ''.join(response).encode('utf-8')
    self.send_response(req.response_status, content, req.response_headers)

dataset/ETHPy150Open benoitc/couchdbkit/couchdbkit/wsgi/handler.py WSGIHandler.handle_line/original