MCPcopy Index your code
hub / github.com/RustPython/RustPython / start_response

Method start_response

Lib/wsgiref/handlers.py:225–249  ·  view source on GitHub ↗

start_response()' callable as specified by PEP 3333

(self, status, headers,exc_info=None)

Source from the content-addressed store, hash-verified

223 self.set_content_length()
224
225 def start_response(self, status, headers,exc_info=None):
226 """'start_response()' callable as specified by PEP 3333"""
227
228 if exc_info:
229 try:
230 if self.headers_sent:
231 raise
232 finally:
233 exc_info = None # avoid dangling circular ref
234 elif self.headers is not None:
235 raise AssertionError("Headers already set!")
236
237 self.status = status
238 self.headers = self.headers_class(headers)
239 status = self._convert_string_type(status, "Status")
240 self._validate_status(status)
241
242 if __debug__:
243 for name, val in headers:
244 name = self._convert_string_type(name, "Header name")
245 val = self._convert_string_type(val, "Header value")
246 assert not is_hop_by_hop(name),\
247 f"Hop-by-hop header, '{name}: {val}', not allowed"
248
249 return self.write
250
251 def _validate_status(self, status):
252 if len(status) < 4:

Callers

nothing calls this directly

Calls 3

_convert_string_typeMethod · 0.95
_validate_statusMethod · 0.95
is_hop_by_hopFunction · 0.85

Tested by

no test coverage detected