Miles Lubin wrote: > I am using PyArg_ParseTuple to parse the arguments (ignoring the keyword > arguments) to my initproc for a type I define. > It seems that something goes wrong inside PyArg_ParseTuple when it gets > the wrong number of arguments (my format string is "OO"); > if the function isn't given exactly two arguments, I get a bus error on > OS X and a segfault on Linux. > If two arguments are given, the code runs as expected. > This does not occur when using PyArg_ParseTuple in a normal method. > Am I not using PyArg_ParseTuple correctly? > > Here's the relevant code: > PyObject *a, *b; > if (!PyArg_ParseTuple(args, "OO", &a, &b)) > return -1; > > The segfault occurs on this line, not on any line after.
I have seen bus errors on FreeBSD when python runs out of stack space. -- ------------------------------------------------------------------------- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: [EMAIL PROTECTED] (pref) | Snail: PO Box 370 [EMAIL PROTECTED] (alt) | Belconnen ACT 2616 Web: http://www.andymac.org/ | Australia -- http://mail.python.org/mailman/listinfo/python-list