embedding Python: how to avoid memory leaks?

"Martin v. Löwis" martin at v.loewis.de
Fri Mar 10 02:52:40 EST 2006


Torsten Bronger wrote:
>>>>I couldn't get the PyRun_*File* calls to work on Windows,
>>>>presumably because of the FILE* problem mentioned in the docs.

> Well, I don't really *know*, but it's hard to believe to me that the
> file descriptor format changed within the Microsoft product series.

The layout of the FILE type indeed didn't change. However, passing
FILE* across different versions of msvcrt will still crash; google
for details. In particular, if you build an application with VC6,
it will be linked with msvcrt4.dll. If you combine this with Python
2.4 (which is linked with msvcr71.dll), you cannot use PyRun_*File*.

Regards,
Martin



More information about the Python-list mailing list