From adafcc06d850605b2f1b2cf34070518d853768db Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Mon, 3 Jan 2011 12:32:44 -0800 Subject: [PATCH] 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. --- tornado/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/web.py b/tornado/web.py index d9e3c7e0..cb15f12a 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):