From: Ben Darnell Date: Mon, 3 Jan 2011 20:32:44 +0000 (-0800) Subject: Log exceptions with exc_info=True instead of exc_info=e. X-Git-Tag: v1.2.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adafcc06d850605b2f1b2cf34070518d853768db;p=thirdparty%2Ftornado.git Log exceptions with exc_info=True instead of exc_info=e. The logging module checks to see if the value passed for exc_info is a tuple, and if so assumes it contains (type, value, traceback). A bug in python 2.5 and 2.6 causes context manager's __exit__ methods to sometimes receive a tuple instead of an exception object, which causes a nonsensical message to be logged. --- diff --git a/tornado/web.py b/tornado/web.py index d9e3c7e06..cb15f12a7 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -875,7 +875,7 @@ class RequestHandler(object): self.send_error(e.status_code, exception=e) else: logging.error("Uncaught exception %s\n%r", self._request_summary(), - self.request, exc_info=e) + self.request, exc_info=True) self.send_error(500, exception=e) def _ui_module(self, name, module):