diff options
author | Marcel Hellkamp <marc@gsites.de> | 2011-12-22 16:29:10 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2011-12-22 19:45:42 +0100 |
commit | 8290992b058ae616ac42e86d125b6a38ce3136d8 (patch) | |
tree | c92a3dee7ee77d5a03e66eb7523c0d50a1d3fcaf | |
parent | 58440a5d88597357978e1437c50d57beb9868dec (diff) | |
download | bottle-8290992b058ae616ac42e86d125b6a38ce3136d8.tar.gz |
Fixed a bug in HTTPError.__repr__. The repr() builtin breaks for non-ascii0.9.8
unicode strings.
-rwxr-xr-x | bottle.py | 2 | ||||
-rwxr-xr-x | test/test_wsgi.py | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -192,7 +192,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 8c3edce..d037cc9 100755 --- a/test/test_wsgi.py +++ b/test/test_wsgi.py @@ -77,6 +77,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') |