PyArg_ParseTuple causing segmentation fault
问题 I'm trying to call a c function from my extension and have narrowed the problem down to this test case. #import "Python.h" ... // Called from python with test_method(0, 0, 'TEST') static PyObject* test_method(PyObject *args) { int ok, x, y, size; const char *s; // this causes Segmentation fault //ok = PyArg_ParseTuple(args, "iis#", &x, &y, &s, &size); // also segfaults //if(ok) PyErr_SetString(PyExc_SystemError, 'Exception'); // this does not cause segfault but fills the variables with