Commit 2e013c46 authored by Ralf Schmitt's avatar Ralf Schmitt

get rid of broken unicode error handling

--HG--
extra : transplant_source : t%1C%DA%A7%B3%C3KZ%C9%0F%2C%82%08%93%D4%8Bi%9DWK
parent 3c2ca753
......@@ -221,19 +221,9 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
towrite.append("%x\r\n%s\r\n" % (len(data), data))
else:
towrite.append(data)
try:
_writelines(towrite)
length[0] = length[0] + sum(map(len, towrite))
except UnicodeEncodeError:
print "Encountered unicode while attempting to write wsgi response: ", [x for x in towrite if isinstance(x, unicode)]
traceback.print_exc()
_writelines(
["HTTP/1.0 500 Internal Server Error\r\n",
"Connection: close\r\n",
"Content-type: text/plain\r\n",
"Content-length: 98\r\n",
"\r\n",
"Internal Server Error: wsgi application passed a unicode object to the server instead of a string."])
_writelines(towrite)
length[0] = length[0] + sum(map(len, towrite))
def start_response(status, response_headers, exc_info=None):
status_code[0] = status.split()[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment