At the risk of having a long conversation here with myself... :) It appears that the crash happens in intobject.c of python, at the PyObject *PyInt_FromLong(long ival) function, when it tries to increment the reference counter: Py_INCREF(v); When python.net calls this function first, it calls it with the value of 0, which falls into a special handled range of integers that are dealt with in a small_ints[] array. However, that array never go initialized, so the reference counter crashes. The array would normally be initialized by calling _PyInt_Init(void). Sooo... just to test my theory, i exposed that function and called it explicitly from Python.Runtime.Initialize() and low and behold, import clr now works just fine! So i'll now go on a hunt, and make sure everything is initialized properly, i'm guessing some main init function isn't being called somewhere when using python.net from an embedded python. cheers, laszlo On 08/12/2010 1:35 PM, Laszlo Sebo wrote: Made a little bit of progress, but am now back to square one.. :) |
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet