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.

Author casevh
Recipients casevh
Date 2009-12-01.05:08:32
SpamBayes Score 6.285735e-07
Marked as misclassified No
Message-id <1259644116.32.0.35772934709.issue7414@psf.upfronthosting.co.za>
In-reply-to
Content
An error was reported on c.l.py. The following code in a Python 3
extension module generated an error:

=====================================
If I use the following C code

static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds)
{
  char a, b;
  char *kwlist[] = {"a", "b", NULL};
  if (!PyArg_ParseTupleAndKeywords(args, kwrds, "|CC", kwlist, &a,
&b))
    return NULL;
  ...

then the following works:

>>> foo('a')
>>> foo('a','b')
>>> foo(a='a',b='b')

but the following fails:
>>> foo(b='b')

RuntimeError: impossible<bad format char>: 'CC'

======================================

I traced it down to missing case statement for "C" in skipitem() in
getargs.c. The attached patch seems to fix the issue.
History
Date User Action Args
2009-12-01 05:08:36casevhsetrecipients: + casevh
2009-12-01 05:08:36casevhsetmessageid: <1259644116.32.0.35772934709.issue7414@psf.upfronthosting.co.za>
2009-12-01 05:08:34casevhlinkissue7414 messages
2009-12-01 05:08:33casevhcreate