summaryrefslogtreecommitdiff
path: root/paste/cgitb_catcher.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-22 00:04:53 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-04-22 00:04:53 +0200
commitd634e965d9de2efe87888c8afad5b82cbca97bdf (patch)
tree3963425d7ae1c1e975d55305699474775cffa0ad /paste/cgitb_catcher.py
parenta866d3fe38fc7c212abf90355ecffe51864ccf5b (diff)
downloadpaste-d634e965d9de2efe87888c8afad5b82cbca97bdf.tar.gz
Fix cgitb_catcher on Python 3
Diffstat (limited to 'paste/cgitb_catcher.py')
-rw-r--r--paste/cgitb_catcher.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/paste/cgitb_catcher.py b/paste/cgitb_catcher.py
index 3185506..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):