Commit 61b5efc2 authored by Senthil Kumaran's avatar Senthil Kumaran

Fix closed Issue #11968 - the start_response header values in wsgiref shoudl be

str not bytes. The PEP-0333 says that and test_wsgiref follows the same.
Updated docs accordingly.
parent 4de00a2e
...@@ -122,8 +122,8 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see ...@@ -122,8 +122,8 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see
def simple_app(environ, start_response): def simple_app(environ, start_response):
setup_testing_defaults(environ) setup_testing_defaults(environ)
status = b'200 OK' status = '200 OK'
headers = [(b'Content-type', b'text/plain; charset=utf-8')] headers = [('Content-type', 'text/plain; charset=utf-8')]
start_response(status, headers) start_response(status, headers)
...@@ -414,8 +414,8 @@ Paste" library. ...@@ -414,8 +414,8 @@ Paste" library.
# Our callable object which is intentionally not compliant to the # Our callable object which is intentionally not compliant to the
# standard, so the validator is going to break # standard, so the validator is going to break
def simple_app(environ, start_response): def simple_app(environ, start_response):
status = b'200 OK' # HTTP Status status = '200 OK' # HTTP Status
headers = [(b'Content-type', b'text/plain')] # HTTP Headers headers = [('Content-type', 'text/plain')] # HTTP Headers
start_response(status, headers) start_response(status, headers)
# This is going to break because we need to return a list, and # This is going to break because we need to return a list, and
...@@ -754,8 +754,8 @@ This is a working "Hello World" WSGI application:: ...@@ -754,8 +754,8 @@ This is a working "Hello World" WSGI application::
# is a dictionary containing CGI-style envrironment variables and the # is a dictionary containing CGI-style envrironment variables and the
# second variable is the callable object (see PEP 333). # second variable is the callable object (see PEP 333).
def hello_world_app(environ, start_response): def hello_world_app(environ, start_response):
status = b'200 OK' # HTTP Status status = '200 OK' # HTTP Status
headers = [(b'Content-type', b'text/plain; charset=utf-8')] # HTTP Headers headers = [('Content-type', 'text/plain; charset=utf-8')] # HTTP Headers
start_response(status, headers) start_response(status, headers)
# The returned object is going to be printed # The returned object is going to be printed
......
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