More unicode nonsense
@@ -128,8 +128,10 @@ class RequestDispatcher(object):
# user still tries read from it, it will return empty.
chunk = yield request.argstreams[0].read()
while chunk:
- if six.PY3 and isinstance(chunk, str):
- chunk = chunk.encode('utf-8')
+ if six.PY3 and isinstance(chunk, str) and isinstance(request.endpoint, bytes):
+ chunk = chunk.encode('utf8')
+ if six.PY3 and isinstance(request.endpoint, str) and isinstance(chunk, bytes):
+ request.endpoint = request.endpoint.encode('utf8')
request.endpoint += chunk
chunk = yield request.argstreams[0].read()
