From 20820f2e85e6e4937e76f83c37b04e3eeda76308 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 20 Jul 2005 00:47:10 +0000 Subject: [PATCH] Made ModPythonHandler.get_response() tolerant of repr(request) that has an exception git-svn-id: http://code.djangoproject.com/svn/django/trunk@232 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/handlers/modpython.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py index 8e2a8843f3..9d74eee59a 100644 --- a/django/core/handlers/modpython.py +++ b/django/core/handlers/modpython.py @@ -235,7 +235,11 @@ class ModPythonHandler: return self.get_technical_error_response() else: subject = 'Coding error (%s IP)' % (request.META['REMOTE_ADDR'] in INTERNAL_IPS and 'internal' or 'EXTERNAL') - message = "%s\n\n%s" % (self._get_traceback(), request) + try: + request_repr = repr(request) + except: + request_repr = "Request repr() unavailable" + message = "%s\n\n%s" % (self._get_traceback(), request_repr) mail_admins(subject, message, fail_silently=True) return self.get_friendly_error_response(request, conf_module)