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 eryksun
Recipients BreamoreBoy, alexis, dstufft, eric.araujo, eryksun, loewis, paul.moore, rantanen, steve.dower, tarek, tim.golden, zach.ware
Date 2015-09-25.03:15:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443150907.74.0.253824439464.issue4918@psf.upfronthosting.co.za>
In-reply-to
Content
There haven't been any fundamental changes to bdist_wininst in years, and bdist_wheel has mostly replaced it nowadays. 

I'm fairly certain this issue was fixed by Mark Hammond's fix for issue 4566. Just to be certain, I updated the code to use print as a function and used 3.4 to build "Simple-Python 3.4.3.win-amd64.exe". I installed this to 3.5, and the post-install script ran successfully. So I'm re-tagging this issue for versions 2.7 and 3.2 and closing it as a duplicate.

In summary, Python built with VS 2008 needs an activation context for the CRT assembly, which is required to load msvcr90.dll. Normally this comes from the application executable, such as python.exe. But when Python is embedded, it may be the case that the application lacks the required activation context (e.g. a bdist_wininst installer created by Python 2.5). Mark Hammond's fix works around this problem by saving and reusing the activation context from when the Python DLL was loaded. This activation context is based on the DLL's resource #2 manifest, which includes the CRT assembly.

One remaining problem for embedding Python 2.7 is accessing msvcr90.dll via ctypes. But it's ctypes! Just dynamically create an activation context.
History
Date User Action Args
2015-09-25 03:15:07eryksunsetrecipients: + eryksun, loewis, paul.moore, tim.golden, tarek, eric.araujo, rantanen, alexis, BreamoreBoy, zach.ware, steve.dower, dstufft
2015-09-25 03:15:07eryksunsetmessageid: <1443150907.74.0.253824439464.issue4918@psf.upfronthosting.co.za>
2015-09-25 03:15:07eryksunlinkissue4918 messages
2015-09-25 03:15:05eryksuncreate