We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d063f68 commit 3539f87Copy full SHA for 3539f87
pymysql/connections.py
@@ -638,7 +638,7 @@ def _read_packet(self, packet_type=MysqlPacket):
638
:raise OperationalError: If the connection to the MySQL server is lost.
639
:raise InternalError: If the packet sequence number is wrong.
640
"""
641
- buff = b''
+ buff = bytearray()
642
while True:
643
packet_header = self._read_bytes(4)
644
#if DEBUG: dump_packet(packet_header)
@@ -666,7 +666,7 @@ def _read_packet(self, packet_type=MysqlPacket):
666
if bytes_to_read < MAX_PACKET_LEN:
667
break
668
669
- packet = packet_type(buff, self.encoding)
+ packet = packet_type(bytes(buff), self.encoding)
670
packet.check_error()
671
return packet
672
0 commit comments