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

Method _check_sendfile_params

Lib/socket.py:461–472  ·  view source on GitHub ↗
(self, file, offset, count)

Source from the content-addressed store, hash-verified

459 file.seek(offset + total_sent)
460
461 def _check_sendfile_params(self, file, offset, count):
462 if 'b' not in getattr(file, 'mode', 'b'):
463 raise ValueError("file should be opened in binary mode")
464 if not self.type & SOCK_STREAM:
465 raise ValueError("only SOCK_STREAM type sockets are supported")
466 if count is not None:
467 if not isinstance(count, int):
468 raise TypeError(
469 "count must be a positive integer (got {!r})".format(count))
470 if count <= 0:
471 raise ValueError(
472 "count must be a positive integer (got {!r})".format(count))
473
474 def sendfile(self, file, offset=0, count=None):
475 """sendfile(file[, offset[, count]]) -> sent

Callers 2

_sendfile_use_sendMethod · 0.95

Calls 3

getattrFunction · 0.85
isinstanceFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected