Web UI: Fix str vs bytes mess in error message handling
Displaying the error message failed resulting in an empty page and a (hidden) trace back. Resolves: #180
This commit is contained in:
parent
927f483c19
commit
55dd81886a
|
@ -382,19 +382,19 @@ class BServer:
|
|||
|
||||
def errorMessage(self, name, e, _):
|
||||
return [
|
||||
b"""<html>
|
||||
("""<html>
|
||||
<head>
|
||||
<title>""", _("Error generating %s") % _(name).encode(),
|
||||
b"""</title>
|
||||
<title>""" + _("Error generating %s") % _(name) +
|
||||
"""</title>
|
||||
<meta name="flattr:id" content="456799">
|
||||
</head>
|
||||
<body>
|
||||
<h1>""" + _("An error occurred!") + "</h1>",
|
||||
u"".join(u"<p>%s</p>" % cgi.escape(s) for s in type(u"")(e).split(u"\n")).encode('utf-8'),
|
||||
b"""
|
||||
<h1>""" + _("An error occurred!") + "</h1>" +
|
||||
"".join(u"<p>%s</p>" % cgi.escape(s) for s in type(u"")(e).split(u"\n")) +
|
||||
"""
|
||||
</body>
|
||||
</html>
|
||||
""" ]
|
||||
""").encode("utf-8") ]
|
||||
|
||||
def serveStatic(self, environ, start_response):
|
||||
filename = environ["PATH_INFO"][len("/static/"):]
|
||||
|
|
Loading…
Reference in New Issue