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

Method read

Lib/ssl.py:1129–1148  ·  view source on GitHub ↗

Read up to LEN bytes and return them. Return zero-length string on EOF.

(self, len=1024, buffer=None)

Source from the content-addressed store, hash-verified

1127 self.getpeername()
1128
1129 def read(self, len=1024, buffer=None):
1130 """Read up to LEN bytes and return them.
1131 Return zero-length string on EOF."""
1132
1133 self._checkClosed()
1134 if self._sslobj is None:
1135 raise ValueError("Read on closed or unwrapped SSL socket.")
1136 try:
1137 if buffer is not None:
1138 return self._sslobj.read(len, buffer)
1139 else:
1140 return self._sslobj.read(len)
1141 except SSLError as x:
1142 if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
1143 if buffer is not None:
1144 return 0
1145 else:
1146 return b''
1147 else:
1148 raise
1149
1150 def write(self, data):
1151 """Write DATA to the underlying SSL channel. Returns

Callers 2

recvMethod · 0.95
recv_intoMethod · 0.95

Calls 2

_checkClosedMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected