Jump to content

  • Log In with Google      Sign In   
  • Create Account


PyRun_SimpleFile(fp, "Test.py") problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 PGSCreativeDirector   Members   -  Reputation: 48

Like
0Likes
Like

Posted 25 October 2011 - 03:37 AM

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");



here's my code

Py_Initialize();


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


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


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

#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:??)

i know its to do with c runtime libarys but what exactly is the solution?


Sponsor:

#2 PGSCreativeDirector   Members   -  Reputation: 48

Like
0Likes
Like

Posted 25 October 2011 - 08:06 AM

i havn't found any solution yet :( any help would be nice

#3 Ectara   Crossbones+   -  Reputation: 2883

Like
0Likes
Like

Posted 25 October 2011 - 05:56 PM

Are you checking the return value of fopen()?

#4 Trienco   Crossbones+   -  Reputation: 2090

Like
1Likes
Like

Posted 25 October 2011 - 11:02 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS