diff options
author | Marcel Hellkamp <marc@gsites.de> | 2011-12-22 16:29:10 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2011-12-22 16:33:14 +0100 |
commit | 3d86eac2138d8d2c41ffb54fc1292a14acf3d5e7 (patch) | |
tree | d7b7e56a861c5907e56675d57555bcbc1fe7fbb0 | |
parent | f1a216cec765c77f4c5e7b66bfdfce9494c6a51b (diff) | |
download | bottle-3d86eac2138d8d2c41ffb54fc1292a14acf3d5e7.tar.gz |
Fixed a bug in HTTPError.__repr__. The repr() builtin breaks for non-ascii
unicode strings.
-rwxr-xr-x | bottle.py | 2 | ||||
-rwxr-xr-x | test/test_wsgi.py | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -227,7 +227,7 @@ class HTTPError(HTTPResponse): self.traceback = traceback def __repr__(self): - return template(ERROR_PAGE_TEMPLATE, e=self) + return tonat(template(ERROR_PAGE_TEMPLATE, e=self)) diff --git a/test/test_wsgi.py b/test/test_wsgi.py index 780399b..d3f8641 100755 --- a/test/test_wsgi.py +++ b/test/test_wsgi.py @@ -72,6 +72,11 @@ class TestWsgi(ServerTestBase): def test(): return 1/0 self.assertStatus(500, '/') + def test_500_unicode(self): + @bottle.route('/') + def test(): raise Exception(touni('Unicode äöüß message.')) + self.assertStatus(500, '/') + def test_utf8_url(self): """ WSGI: Exceptions within handler code (HTTP 500) """ @bottle.route('/my/:string') |