[Python-Dev] PyRun_* functions

Mark Hammond mhammond@skippinet.com.au
Sat, 26 Apr 2003 10:27:48 +1000

> Its seems that it would be a good enhancement to remove the
> FILE pointer
> parameter from these functions, and just use the file name.
> For example,
> change PyRun_SimpleFile( FILE *fp, char *filename) to
> PyRun_SimpleFile(char
> *filename). Then no one would have to worry about the incompatibility.

Or simply a PyFile_Open/Close pair - exactly mirroring fopen(), but inside
the Python DLL, so guaranteed to use the same library.

I believe the only reason this hasn't come up before as a patch is that
PyRun_() functions that take file objects are great "getting started"
functions, but tend to not be used in real apps - in that case the
requirements start getting tricker, so you tend to drop down to the
lower-level Python APIs.

If it really did worry you, I would expect a patch at sourceforge with these
2 new functions would have a good chance of getting in.