MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / _read_bytes

Method _read_bytes

pymysql/connections.py:806–829  ·  view source on GitHub ↗
(self, num_bytes)

Source from the content-addressed store, hash-verified

804 return packet
805
806 def _read_bytes(self, num_bytes):
807 self._sock.settimeout(self._read_timeout)
808 while True:
809 try:
810 data = self._rfile.read(num_bytes)
811 break
812 except OSError as e:
813 if e.errno == errno.EINTR:
814 continue
815 self._force_close()
816 raise err.OperationalError(
817 CR.CR_SERVER_LOST,
818 f"Lost connection to MySQL server during query ({e})",
819 )
820 except BaseException:
821 # Don't convert unknown exception to MySQLError.
822 self._force_close()
823 raise
824 if len(data) < num_bytes:
825 self._force_close()
826 raise err.OperationalError(
827 CR.CR_SERVER_LOST, "Lost connection to MySQL server during query"
828 )
829 return data
830
831 def _write_bytes(self, data):
832 self._sock.settimeout(self._write_timeout)

Callers 1

_read_packetMethod · 0.95

Calls 2

_force_closeMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected