Skip to content

Commit e5556cd

Browse files
authored
gh-155621: Fix unrepresentable defaults in socket.sendmsg() signature (#155623)
1 parent a7b2e1f commit e5556cd

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

Lib/test/test_inspect/test_inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6340,7 +6340,7 @@ def test_socket_module_has_signatures(self):
63406340
# depends on the number of the arguments.
63416341
methods_no_signature = {'ioctl', 'sendto', 'setsockopt'}
63426342
# These have parameters with unrepresentable default values.
6343-
methods_unsupported_signature = {'listen', 'sendmsg', 'sendmsg_afalg'}
6343+
methods_unsupported_signature = {'listen', 'sendmsg_afalg'}
63446344
defined = vars(socket.SocketType).keys()
63456345
self._test_module_has_signatures(socket,
63466346
no_signature, unsupported_signature,

Modules/clinic/socketmodule.c.h

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/socketmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4990,9 +4990,9 @@ sock_sendmsg_impl(PySocketSockObject *s, void *data)
49904990
_socket.socket.sendmsg
49914991
self as s: self(type="PySocketSockObject *")
49924992
buffers as data_arg: object
4993-
ancdata as cmsg_arg: object = NULL
4993+
ancdata as cmsg_arg: object(c_default="NULL") = ()
49944994
flags: int = 0
4995-
address as addr_arg: object = NULL
4995+
address as addr_arg: object(c_default="NULL") = None
49964996
/
49974997
49984998
Send normal and ancillary data to the socket.
@@ -5016,7 +5016,7 @@ static PyObject *
50165016
_socket_socket_sendmsg_impl(PySocketSockObject *s, PyObject *data_arg,
50175017
PyObject *cmsg_arg, int flags,
50185018
PyObject *addr_arg)
5019-
/*[clinic end generated code: output=3b4cb1110644ce39 input=8ae408971a3aa329]*/
5019+
/*[clinic end generated code: output=3b4cb1110644ce39 input=5fdf9b49bed3848b]*/
50205020

50215021
{
50225022
Py_ssize_t i, ndatabufs = 0, ncmsgs, ncmsgbufs = 0;

0 commit comments

Comments
 (0)