diff options
Diffstat (limited to 'paste/cgitb_catcher.py')
-rw-r--r-- | paste/cgitb_catcher.py | 4 |
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): |