]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Log exceptions with exc_info=True instead of exc_info=e.
authorBen Darnell <ben@bendarnell.com>
Mon, 3 Jan 2011 20:32:44 +0000 (12:32 -0800)
committerBen Darnell <ben@bendarnell.com>
Mon, 3 Jan 2011 20:52:11 +0000 (12:52 -0800)
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

index d9e3c7e06f16ef0fe0914087ef1ba37f92800c78..cb15f12a71c09efbc683fb37dcf2fbc83db65f9b 100644 (file)
@@ -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):