Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57e6eac

Browse files
committed
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.
1 parent dd2e94d commit 57e6eac

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Doc/library/wsgiref.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see
122122
def simple_app(environ, start_response):
123123
setup_testing_defaults(environ)
124124

125-
status = b'200 OK'
126-
headers = [(b'Content-type', b'text/plain; charset=utf-8')]
125+
status = '200 OK'
126+
headers = [('Content-type', 'text/plain; charset=utf-8')]
127127

128128
start_response(status, headers)
129129

@@ -414,8 +414,8 @@ Paste" library.
414414
# Our callable object which is intentionally not compliant to the
415415
# standard, so the validator is going to break
416416
def simple_app(environ, start_response):
417-
status = b'200 OK' # HTTP Status
418-
headers = [(b'Content-type', b'text/plain')] # HTTP Headers
417+
status = '200 OK' # HTTP Status
418+
headers = [('Content-type', 'text/plain')] # HTTP Headers
419419
start_response(status, headers)
420420

421421
# 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::
754754
# is a dictionary containing CGI-style envrironment variables and the
755755
# second variable is the callable object (see PEP 333).
756756
def hello_world_app(environ, start_response):
757-
status = b'200 OK' # HTTP Status
758-
headers = [(b'Content-type', b'text/plain; charset=utf-8')] # HTTP Headers
757+
status = '200 OK' # HTTP Status
758+
headers = [('Content-type', 'text/plain; charset=utf-8')] # HTTP Headers
759759
start_response(status, headers)
760760

761761
# The returned object is going to be printed

0 commit comments

Comments
 (0)