I've been playing with the Python 3.3 C-API to see if I could possibly use it in a planned upcoming project, and almost immediately ran into problems.
Even code this simple crashes with 0xc0000005 as the return:
#include <Python.h>
#include <cstdio>
int main(){
Py_Initialize();
Py_IncRef(Py_True); //just in case?
PyObject_Print(Py_True,stdout,Py_PRINT_RAW);
Py_DecRef(Py_True);
Py_Finalize();
return 0;
}
Testing shows PyObject_Print is generating the crash. What's wrong with this code and/or my setup?