diff options
Diffstat (limited to 'paste/evalexception/middleware.py')
-rw-r--r-- | paste/evalexception/middleware.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py index 481d498..da7876d 100644 --- a/paste/evalexception/middleware.py +++ b/paste/evalexception/middleware.py @@ -332,7 +332,10 @@ class EvalException(object): start_response('500 Internal Server Error', headers, exc_info) - environ['wsgi.errors'].write('Debug at: %s\n' % view_uri) + msg = 'Debug at: %s\n' % view_uri + if six.PY3: + msg = msg.encode('utf8') + environ['wsgi.errors'].write(msg) exc_data = collector.collect_exception(*exc_info) debug_info = DebugInfo(count, exc_info, exc_data, base_path, @@ -341,7 +344,7 @@ class EvalException(object): self.debug_infos[count] = debug_info if self.xmlhttp_key: - get_vars = wsgilib.parse_querystring(environ) + get_vars = request.parse_querystring(environ) if dict(get_vars).get(self.xmlhttp_key): exc_data = collector.collect_exception(*exc_info) html = formatter.format_html( @@ -355,7 +358,7 @@ class EvalException(object): def exception_handler(self, exc_info, environ): simple_html_error = False if self.xmlhttp_key: - get_vars = wsgilib.parse_querystring(environ) + get_vars = request.parse_querystring(environ) if dict(get_vars).get(self.xmlhttp_key): simple_html_error = True return errormiddleware.handle_exception( @@ -417,6 +420,8 @@ class DebugInfo(object): 'repost_button': repost_button or '', 'head_html': head_html, 'body': html} + if six.PY3: + page = page.encode('utf8') return [page] def eval_javascript(self): |