[issue4120] Do not embed manifest files in *.pyd when compiling with MSVC

Christoph Gohlke report at bugs.python.org
Thu Oct 29 03:07:35 CET 2009


Christoph Gohlke <cgohlke at uci.edu> added the comment:

Apparently the msvc9compiler_stripruntimes_regexp2 patch causes problems
for MinGW users. The following C program is using the Python C API to
import the testpyd extension generated by testpyd.py. When compiled with
MinGW, the program fails with "ImportError: DLL load failed:..." if the
PYD extension is compiled with MSVC9 and the patch is applied. The
program works if 1) it is compiled with MSVC9, or 2) the testpyd
extension is build without the patch, or 3) the files
Microsoft.VC90.CRT.manifest and msvcr90.dll are placed next to the
executable and the manifest is also embedded into the executable (e.g.
using mt.exe).


/* Import the testpyd.pyd module. */
#include <Python.h>
int main(void) {
    Py_Initialize();
    { 
        PyObject *p = PyImport_ImportModule("testpyd"); 
    }
    Py_Finalize();
    return 0;
}

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4120>
_______________________________________


More information about the Python-bugs-list mailing list