[ python-Bugs-1283289 ] PyArg_ParseTupleAndKeywords gives misleading error message

SourceForge.net noreply at sourceforge.net
Fri Dec 16 20:43:39 CET 2005


Bugs item #1283289, was opened at 2005-09-06 21:12
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1283289&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: japierro (japierro)
>Assigned to: Martin v. Löwis (loewis)
Summary: PyArg_ParseTupleAndKeywords gives misleading error message

Initial Comment:
Python 2.3.3 on Windows XP

If the user supplies one valid and one invalid keyword to 
a function that defines two required keyword arguments, 
PyArg_ParseTupleAndKeywords will raise this 
exception:

TypeError: function takes exactly 2 arguments (1 given)

If, in getargs.c, vgetargskeywords, the check 
for "extraneous keywords" were done near the top of the 
function, a more meaningful exception would be thrown:

TypeError: 'bad' is an invalid keyword argument for this 
function


----------------------------------------------------------------------

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-12-16 20:43

Message:
Logged In: YES 
user_id=1188172

Any opinions?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1283289&group_id=5470


More information about the Python-bugs-list mailing list