From a3edca49a079e2ebc9d9e5dbf7b5c34fdf74513b Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 16 Dec 2003 23:13:48 +0000 Subject: [PATCH] Workaround for bug in cgitb. --- src/log.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/log.py b/src/log.py index 729e55de4..5727eee0c 100644 --- a/src/log.py +++ b/src/log.py @@ -64,7 +64,11 @@ class Formatter(logging.Formatter): if issubclass(e.__class__, exn): raise if conf.detailedTracebacks: - return cgitb.text((E, e, tb)).rstrip('\r\n') + try: + return cgitb.text((E, e, tb)).rstrip('\r\n') + except: + log.error('Cgitb.text raised an exception.') + return logging.Formatter.formatException(self, (E, e, tb)) else: return logging.Formatter.formatException(self, (E, e, tb))