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:34:51 +0100 |
commit | 342d3f62409e1bff057ae9d964ac8848d79e5016 (patch) | |
tree | 068a71c54fbc1c474eff654ca4b020d2615007a3 | |
parent | 24768b618a6e07dff5bfbd1527ed6a52a328277e (diff) | |
download | bottle-342d3f62409e1bff057ae9d964ac8848d79e5016.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
@@ -233,7 +233,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 19543c9..953ee30 100755 --- a/test/test_wsgi.py +++ b/test/test_wsgi.py @@ -76,6 +76,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') |