connection.py : socket.MSG_WAITALL not available on windows version of python
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Connector/Python |
Fix Released
|
Critical
|
Geert JM Vanderkelen |
Bug Description
In connection.py, there are two references to socket.MSG_WAITALL.
1) header = self.sock.recv(4, socket.MSG_WAITALL)
2) buf = header + self.sock.
This is not available on windows version of python and results in an error message: module' has no attribute socket.MSG_WAITALL
Workaround below:
def recv(self):
"""
Receive packets using the socket from the server.
"""
try:
# HACK: MSG_WAITALL not available on windows
#header = self.sock.recv(4, socket.MSG_WAITALL)
header = self.read_
# HACK: MSG_WAITALL not available on windows
#buf = header + self.sock.
buf = header + self.read_
except socket.timeout, errmsg:
raise InterfaceError(
return (buf, pktsize, pktnr)
def read_exactly(self, sock, size):
buffer = ''
while len(buffer) < size:
data = sock.recv(
if not data:
return buffer
Changed in myconnpy: | |
assignee: | nobody → Geert JM Vanderkelen (geertjmvdk) |
importance: | Undecided → Critical |
status: | New → In Progress |
Changed in myconnpy: | |
status: | Fix Committed → Fix Released |
Thanks for this report!
I've put it Critical as we need to get it working OK for Windows environment.