[Python-Dev] PyRun_ with file name

Brad Clements bkc at murkworks.com
Mon Aug 9 16:27:05 CEST 2004


On 9 Aug 2004 at 9:08, Martin v. Löwis wrote:

> The end result is that the _lock_file operation crashes. As MSDN
> explains, you must not pass FILE* across CRTs. The proposed patch avoids
> the problem by passing file names instead.

I vaugely recall having a similar problem embedding Python perhaps two years ago. At that 
time I had contemplated adding a function to python.dll along the lines of 

FILE * Py_OpenFile(char *filename, char *mode) 

The sole purpose of this function was to allow embedding applications to use 
PyRun_SimpleFile and similar python.dll functions that expect a (crt) FILE object. 

I'm sorry I can't remember the exact use case. I'm not proposing Py_OpenFile as a solution 
to this problem. 

I just wanted to speak up and say "me too". 

+1



-- 
Brad Clements,                bkc at murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
http://www.wecanstopspam.org/                   AOL-IM: BKClements



More information about the Python-Dev mailing list