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
bdist_wininst installer with install script raises exception #48886
Comments
Running a bdist_wininst installer that contains a install script, with This is probably because the bdist_wininst installer stubs (in the |
Can you still reproduce in 3.1 and 3.2? |
The crash message is the same as the one in bpo-4918; it looks like bdist_wininst need better error reporting. |
I confirm this is happening with 3.2.4 from an installer generated in 2.7.4 (64bit Win7, 32bit python): https://pypi.python.org/pypi/leo/4.11.devel-build-5802 |
It turns out this is pretty easy to fix by just changing the stub to import builtins or __builtin__ depending on the python install version. Attached are patches that fix this for both the default and 2.7 branches. My test case is a pure python module with an install script. I've rebuilt the wininst stub for both default (3.3) with VS2010 Express and 2.7 with VS2008 Express. I then built installers and ran them in both directions: installer created with python-2.7 and installed into python-3.3, and an installer created with python-3.3 and installed into python-2.7. Both worked fine with no warnings. I've attached the stubs I built in case they're helpful. wininst-10.0-compat.exe is the 32 bit stub for default/3.3. wininst-9.0-compat-2.7.exe is the 32 bit stub for 2.7. |
I think the exe files are specific to one Python version, so the version check would not be necessary. I may be wrong though, as I’m not a windows dev or user, so I’m adding Mark to this issue. |
Right, that's what makes this difficult. If the stub exe of the target python was used, then it wouldn't need to care about compatibility. However, what you're running is the stub of the build python. So, when I distribute a bdist_wininst exe, it's running the stub from my python on the user's machine. That introduces a few compatibility issues.
The situation you're describing where the wininst of the target is run could maybe be made to work, but it would be a larger project. |
The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802. |
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: