From 1b6b3a007ff24c92fac413c21dbd694c0d2b685f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 20 Feb 2014 11:19:22 -0800 Subject: [PATCH] server: Don't use a keyword for the response_headers argument to start_response Despite being documented as response_headers [1], using a keyword argument raises a TypeError: TypeError: start_response() got an unexpected keyword argument 'response_headers' [1]: http://legacy.python.org/dev/peps/pep-0333/#the-start-response-callable --- package_cache/server.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package_cache/server.py b/package_cache/server.py index b5a77f0..f31ddce 100644 --- a/package_cache/server.py +++ b/package_cache/server.py @@ -24,7 +24,7 @@ class Server (object): return self._serve_request( environ=environ, start_response=start_response) except InvalidFile: - start_response(status='404 Not Found', response_headers=[]) + start_response('404 Not Found', []) def _serve_request(self, environ, start_response): method = environ['REQUEST_METHOD'] @@ -55,9 +55,7 @@ class Server (object): file_iterator = environ['wsgi.file_wrapper'](f) else: file_iterator = iter(lambda: f.read(block_size), '') - start_response( - status='200 OK', - response_headers=list(headers.items())) + start_response('200 OK', list(headers.items())) return file_iterator def _get_content_length(self, path): -- 2.26.2