diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2012-12-26 06:44:11 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2012-12-26 06:44:11 -0500 |
commit | 29b9941022a796abe1f45ae88145ca71b30e7d42 (patch) | |
tree | 14c34fd8dc098e3e7b80981ebe9a8481275665fa | |
parent | 50574da99d6d75d2d99e7566c65431cdf7d076bc (diff) | |
download | cherrypy-29b9941022a796abe1f45ae88145ca71b30e7d42.tar.gz |
Fixed failure on Python 2 in cherrypy.test.test_json:JsonTest.test_json_input when the error message had unicode in it.
-rw-r--r-- | cherrypy/_cperror.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cherrypy/_cperror.py b/cherrypy/_cperror.py index 3a60d150..0e6fb624 100644 --- a/cherrypy/_cperror.py +++ b/cherrypy/_cperror.py @@ -372,8 +372,8 @@ class HTTPError(CherryPyException): response.headers['Content-Type'] = "text/html;charset=utf-8" response.headers.pop('Content-Length', None) - content = ntob(self.get_error_page(self.status, traceback=tb, - message=self._message), 'utf-8') + content = self.get_error_page(self.status, traceback=tb, + message=self._message).encode('utf-8') response.body = content _be_ie_unfriendly(self.code) |