summaryrefslogtreecommitdiff
path: root/wsgitools/middlewares.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2012-06-29 09:26:09 +0200
committerHelmut Grohne <helmut@subdivi.de>2012-06-29 19:18:56 +0200
commit3f2f7f72a73caf087066c75d2e2b6e5ed908d34d (patch)
tree712eb5665f708f1361917e57c17e5f15487a705b /wsgitools/middlewares.py
parent472144ac68188056eb41c9cb198df04b454a1da2 (diff)
downloadwsgitools-3f2f7f72a73caf087066c75d2e2b6e5ed908d34d.tar.gz
fix more bytes related issues not covered by test.py
* applications returned errors as str instead of bytes * filters documentation updated with bytes * various filters expecting str where bytes are passed * escape_string also needs to use bytes.isalnum instead of str.isalnum * middlewares injecting str where bytes are expected
Diffstat (limited to 'wsgitools/middlewares.py')
-rw-r--r--wsgitools/middlewares.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py
index 725deb1..4061d3b 100644
--- a/wsgitools/middlewares.py
+++ b/wsgitools/middlewares.py
@@ -33,7 +33,7 @@ class SubdirMiddleware:
def __call__(self, environ, start_response):
"""wsgi interface
@type environ: {str: str}
- @rtype: gen([str])
+ @rtype: gen([bytes])
"""
assert isinstance(environ, dict)
app = None
@@ -65,7 +65,7 @@ class NoWriteCallableMiddleware:
def __call__(self, environ, start_response):
"""wsgi interface
@type environ: {str, str}
- @rtype: gen([str])
+ @rtype: gen([bytes])
"""
assert isinstance(environ, dict)
todo = [None]
@@ -89,7 +89,7 @@ class NoWriteCallableMiddleware:
ret = self.app(environ, modified_start_response)
assert hasattr(ret, "__iter__")
- first = ""
+ first = b""
if not isinstance(ret, list):
ret = iter(ret)
stopped = False
@@ -171,7 +171,7 @@ class ContentLengthMiddleware:
return ret
ret = iter(ret)
- first = ""
+ first = b""
stopped = False
while not (first or stopped):
try: