stop.set()
thr.join()
+ def test_address_argument_type_error(self):
+ # Regression test for https://github.com/python/cpython/issues/98793
+ proactor = self.loop._proactor
+ sock = socket.socket(type=socket.SOCK_DGRAM)
+ bad_address = None
+ with self.assertRaises(TypeError):
+ proactor.connect(sock, bad_address)
+ with self.assertRaises(TypeError):
+ proactor.sendto(sock, b'abc', addr=bad_address)
+ sock.close()
+
class WinPolicyTests(WindowsEventsTestCase):
int Length;
int err;
- if (!PyArg_ParseTuple(args, F_HANDLE "O", &ConnectSocket, &AddressObj)) {
+
+ if (!PyArg_ParseTuple(args, F_HANDLE "O!:WSAConnect",
+ &ConnectSocket, &PyTuple_Type, &AddressObj)) {
return NULL;
}
int ret;
DWORD err;
- if (!PyArg_ParseTuple(args, F_HANDLE "O" F_DWORD "O",
- &handle, &bufobj, &flags, &AddressObj))
+ if (!PyArg_ParseTuple(args, F_HANDLE "OkO!:WSASendTo",
+ &handle, &bufobj, &flags, &PyTuple_Type, &AddressObj))
{
return NULL;
}