MCPcopy Index your code
hub / github.com/python/cpython / sendfile

Method sendfile

Lib/wsgiref/handlers.py:305–323  ·  view source on GitHub ↗

Platform-specific file transmission Override this method in subclasses to support platform-specific file transmission. It is only called if the application's return iterable ('self.result') is an instance of 'self.wsgi_file_wrapper'. This method should retu

(self)

Source from the content-addressed store, hash-verified

303
304
305 def sendfile(self):
306 """Platform-specific file transmission
307
308 Override this method in subclasses to support platform-specific
309 file transmission. It is only called if the application's
310 return iterable ('self.result') is an instance of
311 'self.wsgi_file_wrapper'.
312
313 This method should return a true value if it was able to actually
314 transmit the wrapped file-like object using a platform-specific
315 approach. It should return a false value if normal iteration
316 should be used instead. An exception can be raised to indicate
317 that transmission was attempted, but failed.
318
319 NOTE: this method should call 'self.send_headers()' if
320 'self.headers_sent' is false and it is going to attempt direct
321 transmission of the file.
322 """
323 return False # No platform-specific transmission by default
324
325
326 def finish_content(self):

Callers 15

finish_responseMethod · 0.95
_sendfileFunction · 0.45
test_sendfileMethod · 0.45
_testNonRegularFileMethod · 0.45
test_sendfileMethod · 0.45
test_sendfile_sslMethod · 0.45

Calls

no outgoing calls