This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: PyRun_SimpleFile crashes application
Type: crash Stage:
Components: Extension Modules, Windows Versions: Python 3.1
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Valery.Lesin, loewis
Priority: normal Keywords:

Created on 2010-10-13 08:50 by Valery.Lesin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg118506 - (view) Author: Valery Lesin (Valery.Lesin) Date: 2010-10-13 08:50
All the functions in Python/C API for file execution (like PyRun_SimpleFile) crash the application.

Some thoughts about problem: these functions use FILE* as first parameter which is binary incompatible with different CRT (python.dll and application could use different ones). 

Some thoughts about solution: maybe it's possible to pass only filename and python will open (and close) file itself? Second idea is to use functions like PyFile_FromString (like in Python 2)
msg118517 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-10-13 12:39
What operating system are you using? What compiler?
msg118518 - (view) Author: Valery Lesin (Valery.Lesin) Date: 2010-10-13 12:54
OS: windows xp
Compiler: MSVC versions 7.1, 8.0 and 9.0 

Actually, the difference in compiler for python library and client applications causes the problem (I suppose that even same compiler with different options could give binary incompatible FILE structures).
msg118521 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-10-13 13:11
Ok, unless you are using the very same compiler that Python was compiled with, this will indeed crash. Closing this as "won't fix", then - use PyRun_SimpleString instead.
History
Date User Action Args
2022-04-11 14:57:07adminsetgithub: 54291
2010-10-13 13:11:48loewissetstatus: open -> closed
resolution: wont fix
messages: + msg118521
2010-10-13 12:54:26Valery.Lesinsetmessages: + msg118518
2010-10-13 12:39:02loewissetnosy: + loewis
messages: + msg118517
2010-10-13 08:50:01Valery.Lesincreate