summaryrefslogtreecommitdiff
path: root/paste/cgitb_catcher.py
diff options
context:
space:
mode:
Diffstat (limited to 'paste/cgitb_catcher.py')
-rw-r--r--paste/cgitb_catcher.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/paste/cgitb_catcher.py b/paste/cgitb_catcher.py
index 55a346f..f88ffb8 100644
--- a/paste/cgitb_catcher.py
+++ b/paste/cgitb_catcher.py
@@ -49,6 +49,8 @@ class CgitbMiddleware(object):
[('content-type', 'text/html')],
exc_info)
response = self.exception_handler(exc_info, environ)
+ if six.PY3:
+ response = response.encode('utf8')
return [response]
def catching_iter(self, app_iter, environ):
@@ -72,6 +74,8 @@ class CgitbMiddleware(object):
response += (
'<hr noshade>Error in .close():<br>%s'
% close_response)
+ if six.PY3:
+ response = response.encode('utf8')
yield response
def exception_handler(self, exc_info, environ):
@@ -83,7 +87,7 @@ class CgitbMiddleware(object):
format=self.format)
hook(*exc_info)
return dummy_file.getvalue()
-
+
def make_cgitb_middleware(app, global_conf,
display=NoDefault,
logdir=None,
@@ -92,7 +96,7 @@ def make_cgitb_middleware(app, global_conf,
"""
Wraps the application in the ``cgitb`` (standard library)
error catcher.
-
+
display:
If true (or debug is set in the global configuration)
then the traceback will be displayed in the browser