PyRun_SimpleFile(fp, "Test.py") problem

Started by
2 comments, last by Trienco 12 years, 6 months ago
[font="Lucida Console"]Hello i'm trying to implement python so i can use it with my application but having issues with segmentation faults when i call PyRun_SimpleFile(fp, "Test.py");[/font]


[font="Lucida Console"]here's my code[/font]

[font="Lucida Console"]Py_Initialize();


FILE *fp = fopen ("Test.py", "r+");


PyRun_SimpleFile(fp, "Test.py");
Py_Finalize();

[/font]

[font="Lucida Console"]i had alook around google but i really dont know how to fix the problem what am i supposed to do? here's there errors i'm getting[/font]

[font="Lucida Console"]#0 76F32239 ntdll!EtwNotificationUnregister() (C:\Windows\system32\ntdll.dll:??)
#1 76F32148 ntdll!EtwNotificationUnregister() (C:\Windows\system32\ntdll.dll:??)
#2 6F18F2CF lock_file() (C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll:??)
#3 6F18E463 getc() (C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll:??)
#4 76BB2960 msvcrt!_iob() (C:\Windows\system32\msvcrt.dll:??)
#5 00000000 0x85652e52 in ??() (??:??)
#6 1E0ADD9D python27!PyParser_ParseFileFlagsEx() (C:\Windows\system32\python27.dll:??)
#7 1E0ADD9B python27!PyParser_ParseFileFlagsEx() (C:\Windows\system32\python27.dll:??)
#8 1E0AE579 python27!PyParser_ParseFileFlagsEx() (C:\Windows\system32\python27.dll:??)

[/font]
[font="Lucida Console"]i know its to do with c runtime libarys but what exactly is the solution?[/font]
Advertisement
i havn't found any solution yet :( any help would be nice
Are you checking the return value of fopen()?
Apparently someones Google skills are lacking, considering that took about 10s to find and looks like a good match...

http://effbot.org/pyfaq/pyrun-simplefile-crashes-on-windows-but-not-on-unix-why.htm
f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement