You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
socket.sendto raises incorrect exception when passed incorrect types #54378
The original code was trying to call PyArg_ParseTuple assuming 2 args and in case of failure (any failure) was starting over assuming 3 args.
The attached patch makes PyArg_ParseTuple accept 2 or 3 args and re-arranges the last two if 'flags' is passed.
The tests pass, but a few more tests should be added.
Activity
exarkun commentedon Oct 21, 2010
The TypeError gives the wrong explanation for what's wrong.
ezio-melotti commentedon May 3, 2011
The original code was trying to call PyArg_ParseTuple assuming 2 args and in case of failure (any failure) was starting over assuming 3 args.
The attached patch makes PyArg_ParseTuple accept 2 or 3 args and re-arranges the last two if 'flags' is passed.
The tests pass, but a few more tests should be added.
ezio-melotti commentedon May 3, 2011
Added tests and fixed all the problems they found.
python-dev commentedon May 7, 2011
New changeset 7c3a20b5943a by Ezio Melotti in branch '2.7':
bpo-10169: Fix argument parsing in socket.sendto() to avoid error masking.
http://hg.python.org/cpython/rev/7c3a20b5943a
ezio-melotti commentedon May 7, 2011
This turned out to be a duplicate of bpo-5421 already fixed in 3.x, so I backported the patch and added the tests to 3.x too.