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.
This commit is contained in:
Ben Darnell 2011-01-03 12:32:44 -08:00
parent f63525f7a4
commit adafcc06d8
1 changed files with 1 additions and 1 deletions

View 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):