New submission from Case Van Horsen <cas...@gmail.com>: 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. ---------- components: Extension Modules files: getargs.patch keywords: patch messages: 95846 nosy: casevh severity: normal status: open title: Format code "C" is missing from skipitem() in getargs.c versions: Python 3.1 Added file: http://bugs.python.org/file15421/getargs.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7414> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com