fix PY3 rocket with bytes stream. ref web2py/pydal#516

This commit is contained in:
ilvalle
2018-02-23 19:43:34 +01:00
parent 623f3b9947
commit 164a271ca8

View File

@@ -1750,7 +1750,7 @@ class WSGIWorker(Worker):
if self.request_method != 'HEAD':
try:
if self.chunked:
self.conn.sendall(b('%x\r\n%s\r\n' % (len(data), data)))
self.conn.sendall(b'%x\r\n%s\r\n' % (len(data), to_bytes(data, 'ISO-8859-1')))
else:
self.conn.sendall(to_bytes(data))
except socket.timeout: