[Distutils] [patch] executable Scripts on windows
anatoly techtonik
techtonik at gmail.com
Fri Oct 17 11:32:29 CEST 2008
Hello,
I would like to discuss a patch that adds executable .bat files for
scripts installed with distutils.
As a windows user with several Python versions installed I often
create shortcuts for Python applications that were installed using
distutils. But I also have to navigate to Scripts/ directory and mess
with script files. Common problems:
1. python script doesn't have .py extension
2. script is actually a shell script
3. script is executed with wrong Python version
The first problem is clear. Files without extension are not executable
on windows. If distutils makes scripts executable on posix, why
shouldn't it do the same on windows? The second problem should be
addressed to package maintainer in the first place. The third one is
also quite common - distutils fixes scripts and inserts correct Python
path in shebang even on windows platform, but it makes little sense,
because the script is executed with the only interpreter that was
associated with .py extensions.
To solve problems 1 and 3 I added patch that adds .bat file to execute
the script with correct python version. As a positive side effect -
the application can be executed through "Run" menu. The patch is
posted into http://bugs.python.org/issue4015 and I would like to know
your opinion about it.
--
--anatoly t.
More information about the Distutils-SIG
mailing list