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.

Author aheider
Recipients aheider
Date 2008-10-14.08:01:47
SpamBayes Score 2.72382e-07
Marked as misclassified No
Message-id <>
The MSVC build process currently embeds the .manifest file, which is
generated by the MS linker, in the following files:

- python.exe
- pythonXY.dll
- *.pyd

The latter is problematic on machines without the MS CRT redistributable
installed (No CRT files in %WINDIR%\WinSxS). While this error won't
occur when the python package is installed, it will in other cases like
in ours:

We use the python interpreter within our application and do ship
python25.dll. We also ship the MS CRT files and place them next to the
main application (MS calls this "private assemblies" and "xcopy
deployment). We do not install the redistributable, because it needs
admin rights.
If a user tries to "import socket" on this setup it will fail, because
the Side by Side / Fusion loader expects the CRT next to the calling
Binary (%PYTHONHOME%\DLLs\_socket.pyd) because of the manifest.

The solution is to not embed the manifest in the *.pyd Modules. This way
the modules just link against msvc*.dll. This works because the windows
loader has already mapped the CRT into memory for the process (either
through python.exe or pythonXY.dll). This is also the only reliable way
i could find to fix the import on machines without redist.

Attached you'll find a patch for the MSVC90 build, apply with -p5. It
will only patch the release file, PCbuild8/pyd_d.vsprops requires the
same fix.

Trolltech also uses this approach for its plugins:
Date User Action Args
2008-10-14 08:01:53aheidersetrecipients: + aheider
2008-10-14 08:01:52aheidersetmessageid: <>
2008-10-14 08:01:50aheiderlinkissue4120 messages
2008-10-14 08:01:48aheidercreate