New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.6.1 breaks many applications that embed Python on Windows #48816
Comments
Applications on Windows that don't link to the MSVCR90.DLL via a To test this, I created a simple application that did nothing but call Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\socket.py", line 46, in <module>
import _socket
ImportError: DLL load failed: The specified module could not be found. When that app links with the C library dynamically, it works properly. In particular, this issue breaks mod_python. From the Apache error log: [Sat Dec 06 00:49:21 2008] [error] make_obcallback: could not import
mod_python.apache.\n
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\mod_python\apache.py", line 29, in
<module>
import cgi
File "C:\Python26\Lib\cgi.py", line 40, in <module>
import urllib
File "C:\Python26\Lib\urllib.py", line 26, in <module>
import socket
File "C:\Python26\lib\socket.py", line 46, in <module>
import _socket
ImportError: DLL load failed: A dynamic link library (DLL)
initialization routine failed. I'm guessing this is a side-effect of the fix for bpo-4120. Since modules Something I discovered (by accident) is that, if there's an external |
I've attached the test program I was using. The commands I used to cl /MT /c /IC:\Python26\include testpy.c |
I've attached a manifest file that references the C runtime; adding this |
I would claim that this is not a bug. There is simpler no other way to |
A mess it is :/ |
I understand the rationale behind bpo-4120, but it seems like it only helps The 2.6.0 behavior - requiring the VS2008 redist to be installed - is |
This is not a narrow set, though. It includes all the applications that
Python has a long tradition of supporting "xcopy deployment". I don't I don't quite understand this issue yet. python26.dll is linked with |
Apparently not, at least in my testing. It seems that if a DLL is I guess I'm more concerned about applications like Apache that only use I understand, though, the value of "xcopy deployment", and I realize |
Here's an option, though unfortunately not a trivial one: use a private For me to build the CRT from the source included with Visual Studio 2008 Also, I'd assume that the CRT source isn't included in the Express As far as Python itself, the project configurations would have to be |
I've no time to dig deeper now as I suspect testing will require removal test.c's error is "can't find the DLL" - this will be as we attempt to That specific error code means the DLL init routine in the CRT started |
I meant to mention: FWIW, *some* py2exe apps work fine with the old |
The test program isn't having a problem loading python26.dll - it gets I do see the error codes are different (between testpy.c and Nonetheless: if I copy the CRT assembly into the same folder as ImportError: DLL load failed: A dynamic link library (DLL) (If the assembly is not in the folder, there is no popup dialog at all.) Also, I see now that I made a mistake in reporting the error code from
Putting the CRT assembly in the Apache bin folder or Apache modules I apologize for the confusion; when I first experienced this problem I To summarize: Apache with CRT assembly in _socket.pyd folder: init routine failed and |
Isn't the GAC just for .NET assemblies while the SxS cache is for non Christian |
I took a look at this with the debugger, as Mark recommended. The CRT's _check_manifest calls an SxS function called FindActCtxSectionString. /* no activation context used to load CRT DLL, means no manifest present What's bizarre is that python26.dll successfully loaded msvcr90.dll (the I don't know if any of this information is useful (I'm only |
I've hacked together something that fixes the problem. I'm working on
This makes the "import socket" test case work for me. I'm not sure what |
Attaching a patch which works for me against python 2.6. Only ever |
Attaching a new patch with some typos in the comments corrected. While
|
I haven't been able to try this patch myself yet, but I see a potential Also, where are you seeing that these SxS functions are "Vista or |
The patch works fine on my system (32-bit XP). Also I verified in |
I'm not sure whether the license allows us to do so. |
Uploading a corrected patch; some old docs I saw said DWORD, and I |
We encountered a problem that Windows installer created with 2.5.2 could |
You should assume that it is not related.
That would be necessary. |
Over 3 years ago I wrote a plugin for the Xplane Flight Simulator. The plugin embeds python and allows python scripts to be run from within I applied the patch that Mark posted and rebuilt python26.dll. I thought that this feedback may be useful. |
Mark, the patch is fine, please apply. Great work! |
ack - I mis-clicked and accidentally removed message78811 and can't see |
Checked in to the trunk as as r69038 and svnmerge'd:
|
After some Googling, I found a possible solution: http://lists.wxwidgets.org/pipermail/wxpython-users/2008-November/081981.html |
For some reason this patch is disabled with #ifdefs when Py_ENABLE_SHARED is not defined. I'm compiling python as a static lib and have unresolved externals for both these functions: _Py_ActivateActCtx, _Py_DeactivateActCtx |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: