MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / read

Method read

tools/python-3.11.9-amd64/Lib/_pyio.py:1076–1087  ·  view source on GitHub ↗

Read size bytes. Returns exactly size bytes of data unless the underlying raw IO stream reaches EOF or if the call would block in non-blocking mode. If size is negative, read until EOF or until read() would block.

(self, size=None)

Source from the content-addressed store, hash-verified

1074 self._read_pos = 0
1075
1076 def read(self, size=None):
1077 """Read size bytes.
1078
1079 Returns exactly size bytes of data unless the underlying raw IO
1080 stream reaches EOF or if the call would block in non-blocking
1081 mode. If size is negative, read until EOF or until read() would
1082 block.
1083 """
1084 if size is not None and size < -1:
1085 raise ValueError("invalid number of bytes to read")
1086 with self._read_lock:
1087 return self._read_unlocked(size)
1088
1089 def _read_unlocked(self, n=None):
1090 nodata_val = b""

Callers

nothing calls this directly

Calls 1

_read_unlockedMethod · 0.95

Tested by

no test coverage detected