This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年10月21日 17:22 by exarkun, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue10169.diff | ezio.melotti, 2011年05月03日 08:13 | Patch against 2.7. | review | |
| issue10169-2.diff | ezio.melotti, 2011年05月03日 09:43 | Patch against 2.7 w/ tests. | review | |
| Messages (5) | |||
|---|---|---|---|
| msg119320 - (view) | Author: Jean-Paul Calderone (exarkun) * (Python committer) | Date: 2010年10月21日 17:22 | |
>>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>>> s.bind(('', 0))
>>> s.sendto(u'hellé', s.getsockname())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: sendto() takes exactly 3 arguments (2 given)
>>> s.sendto(3, s.getsockname())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: sendto() takes exactly 3 arguments (2 given)
>>> s.sendto('hello', s.getsockname())
5
The TypeError gives the wrong explanation for what's wrong.
|
|||
| msg135020 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2011年05月03日 08:13 | |
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. |
|||
| msg135022 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2011年05月03日 09:43 | |
Added tests and fixed all the problems they found. |
|||
| msg135477 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年05月07日 16:51 | |
New changeset 7c3a20b5943a by Ezio Melotti in branch '2.7': #10169: Fix argument parsing in socket.sendto() to avoid error masking. http://hg.python.org/cpython/rev/7c3a20b5943a |
|||
| msg135481 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2011年05月07日 16:54 | |
This turned out to be a duplicate of #5421 already fixed in 3.x, so I backported the patch and added the tests to 3.x too. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:07 | admin | set | github: 54378 |
| 2011年05月07日 16:54:44 | ezio.melotti | set | status: open -> closed versions: - Python 3.1, Python 3.2 messages: + msg135481 resolution: fixed stage: commit review -> resolved |
| 2011年05月07日 16:51:57 | python-dev | set | nosy:
+ python-dev messages: + msg135477 |
| 2011年05月03日 09:43:02 | ezio.melotti | set | keywords:
+ needs review files: + issue10169-2.diff messages: + msg135022 stage: patch review -> commit review |
| 2011年05月03日 08:13:23 | ezio.melotti | set | files:
+ issue10169.diff assignee: ezio.melotti keywords: + patch nosy: + ezio.melotti messages: + msg135020 stage: patch review |
| 2011年05月03日 04:59:47 | falsetru | set | nosy:
+ falsetru |
| 2010年10月23日 18:44:00 | giampaolo.rodola | set | nosy:
+ giampaolo.rodola |
| 2010年10月21日 22:52:35 | eric.araujo | set | nosy:
+ pitrou versions: + Python 3.1, - Python 2.6 |
| 2010年10月21日 17:22:06 | exarkun | create | |