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
Make installed scripts executable on windows #48265
Comments
Distutils contains code to make scripts executable on posix platform. |
As a Windows user, I am not sure I would want this. A run command |
Created .bat files guarantee that scripts will be executed with the |
The same issue in "Roundup Tracker" bugtracker |
I can see how this might be useful, but I agree it should not happen by I'd also like to find a way to pass all args, not just the first 9 - |
I think this should be the default. I am a rookie in python, setup.py in I agree that the batch script can be improved. Here is how ruby gems do it: @echo OFF |
I sometimes use this trick on Windows: name the script with a .bat @echo off |
If you have to name the script with a .bat extension it is not portable The point of generating the bat file is to be able to use the same |
On posix platform, build_scripts already updates the #! line to refer to |
Ok - I see what you mean. I can't see any problems with it. However |
optional .bat file generating - probably not bad idea. Maybe just tool for generating bat files for desired packages based on |
The point is not in generating .bat files. The point is to make scripts There is no other way to fix this on windows than generating separate Embedding python code inside of .bat is not a good idea, because runner |
It is true, that on Windows the "mime types", .py, .pyw point to a Having Python 2.4, 2.5, 2.6, 3.0, 3.1 installed on my hd and Technically, one can argue a Python developer/user should be able to Compared to *x systems, I have always found the Windows way as being |
It could also point to a "python launcher", which reads the first line |
What would that first line look like on Windows? |
I agree. Today starting a .py file only open the last installed Python interpreter. There may be different definitions of "best". The algorithm could look
|
Maybe also let's look on setuptools solution.It can make windows Also there are family scripts for single entry point:
I like it. Exe files executes specific python version. If you are I use setuptools and for me it gives good 'executive python scripts'. BTW, double click executes 'default' interpreter, not last installed. |
The solution with launcher is complex (if not complicated). It will make In case there is a problem with registry (backup/restore/profile |
I've updated the script to parse unlimited number of parameters on NT, It is based on similar workarounds we've made for SCons in In my patch I use Template that has placeholders for product name, |
I totally agree that we must create batch files for commands but not by |
On POSIX the interpreter will be read from the first line of a file. So the correct way to associate a interpreter to a file is to invent a file-extension for every interpreter. I attached a example-registry-patch to register extensions for 2.5, 2.6 and 3.1 . I propose to change all Python-Windows-installer to install versioned extensions. If you want a switcher application, it should read the first line of the script and match it against ".*/python(.*)$". So the default POSIX "#!/usr/bin/python3.1" can be kept unchanged. With that rexex the app-path can be read from "HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\<regex-match>\InstallPath\". BTW. |
Related to bpo-870479 (should we make that one a meta-bug?) |
This issue is so old and I do not have time to reread it fully, unfortunately. I believe I wanted to install packages using "easy_install", "pip" or whatever I have and get Scripts/something.bat for my version of Python. This version is often portable, so registry dependency it is not an option - not a good version at least. Scripts/ can also be located in virtualenv. The similar patch is used for deploying SCons on Windows. |
We’re going to follow setuptools’ lead and generate platform-appropriate script or binary files from callables. |
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: