New submission from Ilya <kaplan.i...@gmail.com>: When embedding python from C, and importing "ctypes" module in embedded script, it always crashes on Py_Finalize() on 4th cycle. Tested with both PyRun_SimpleString(...) and PyRun_String(...). Platform: Windows XP IDE's: LabWindows/CVI 8.5 and Code::Blocks/gcc
Code: -------------------------- #include <stdio.h> #include <python.h> int main() { int i; for (i=0; i<10; i++) { printf("--- %d ---\n", i); Py_Initialize(); PyRun_SimpleString("import ctypes"); Py_Finalize(); } return 0; } -------------------------------- Output: -------------------------------- --- 0 --- --- 1 --- --- 2 --- --- 3 --- Process returned -1073741819 (0xC0000005) execution time : 3.109 s Press any key to continue. -------------------------------- ---------- assignee: theller components: ctypes messages: 92444 nosy: Warlock, theller severity: normal status: open title: Embedded python crashed on 4th run, if "ctypes" is used type: crash versions: Python 2.5, Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6869> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com