summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dent <chris.dent@gmail.com>2019-02-28 15:14:55 +0000
committerChris Dent <chris.dent@gmail.com>2019-02-28 15:14:55 +0000
commita98bf144167b9c4d7ee4a652c15512f6c69ffc8e (patch)
treed363d3b90b5f231a26f8ee78a4b75eba32bced89
parente9d05aaaf39846a77bb36a66bb066490ff85bb24 (diff)
downloadpaste-git-bug/21.tar.gz
Write bytestrings when calling wsgi_write_chunkbug/21
httpservers writes an empty string or an internal server error message, these needs to be bytes in python 3. It might have been useful to have wsgi_write_chunk accept either bytes or strings and do the right thing, but that seemed too invasive to be safe.
-rwxr-xr-xpaste/httpserver.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/httpserver.py b/paste/httpserver.py
index 963285e..f91eb20 100755
--- a/paste/httpserver.py
+++ b/paste/httpserver.py
@@ -306,7 +306,7 @@ class WSGIHandlerMixin:
for chunk in result:
self.wsgi_write_chunk(chunk)
if not self.wsgi_headers_sent:
- self.wsgi_write_chunk('')
+ self.wsgi_write_chunk(b'')
finally:
if hasattr(result,'close'):
result.close()
@@ -321,7 +321,7 @@ class WSGIHandlerMixin:
'500 Internal Server Error',
[('Content-type', 'text/plain'),
('Content-length', str(len(error_msg)))])
- self.wsgi_write_chunk("Internal Server Error\n")
+ self.wsgi_write_chunk(b"Internal Server Error\n")
raise
#