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.
Created on 2005年03月30日 09:05 by vds2212, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| build_scripts.py | vds2212, 2005年03月30日 09:05 | the modified build_scripts.py file | ||
| build_scripts.py | vds2212, 2005年04月02日 06:39 | build_scripts.py | ||
| Messages (4) | |||
|---|---|---|---|
| msg48088 - (view) | Author: Vivian De Smedt (vds2212) | Date: 2005年03月30日 09:05 | |
Distutils have a script functionality that copy the corresponding file into a common script folder (that could be on the path) and sligthly modify the first line of the script to reflect the path of the python executable. It is very nice because it make new commands directly available but for the window platform I think it could be improved. First the extention of the script could be .bat such that they will be accessible as commands as soon as the script folder is in the path. Second the first line adaptation could be slightly different and take advantage of the -x option of the python executable #!python foo bar could become: @C:\Python24\python.exe -x "%~f0" foo bar & exit / b instead of: #!C:\Python24\python.exe -x "%~f0" foo bar & exit / b In attachement I add my modified version of the build_scripts.py file (Revision 1.25, the head of the 30th of March) |
|||
| msg48089 - (view) | Author: Vivian De Smedt (vds2212) | Date: 2005年04月02日 06:39 | |
Logged In: YES user_id=511447 Here is a small summary of the remark made arround the she-bang modification of the windows platform. 1. Trent let us know that the she-bang modification works only for the win nt sons and that in general it is better to use the .bat extension instead of the .cmd one 2. I realize that we shouldn't change the extension of a script if it exist since the extention could be usefull to determine which version of python to run - pythonw for the .pyw extention - python for the .py extention According to these remarks and in the purpose to be as conservative as possible I make this another proposition: The change in the she bang will happend only if - the win32 platform is detected (os.name == "nt") - the platform is win NT son (os.environ["OS"] == "Windows_NT") - the original script had no extension (os.path. splitext(outfile)[1] == "") Furthermore I add the %* in the new nt she-bang to let the underlying script know about command line argument. such that the unix she-bang: #!python foo bar will become: @C:\Python24\Python.exe -x "%%~f0" foo bar %* & exit /b I think that in these conditions the change could only improve the existing situation at least it improve for some them (Zope, Chetaah, PyCrust, IPython) Tell me what you think about the proposed change. Vivian. |
|||
| msg75964 - (view) | Author: anatoly techtonik (techtonik) | Date: 2008年11月17日 15:25 | |
The idea with "-x" option and renaming .py to .bat is nice, but if I want to execute the script with another version of Python or manually without -x option I may become confused. Would it be better to provide separated .bat files to launch scripts? See #4015 |
|||
| msg153688 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年02月19日 09:44 | |
For distutils2, we’re going to generate .exe wrappers on Windows, like setuptools does (see #12394). distutils is feature-frozen. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:10 | admin | set | github: 41776 |
| 2012年02月19日 09:47:55 | eric.araujo | set | status: open -> closed |
| 2012年02月19日 09:44:05 | eric.araujo | set | assignee: tarek -> eric.araujo superseder: packaging: generate scripts from callable (dotted paths) components: + Distutils2, - Distutils, Windows versions: + 3rd party, Python 3.3, - Python 3.2 nosy: + alexis, eric.araujo messages: + msg153688 resolution: rejected stage: resolved |
| 2010年08月10日 11:29:22 | flox | set | assignee: tarek components: + Windows nosy: + tarek |
| 2010年08月07日 20:54:01 | terry.reedy | set | versions: + Python 3.2, - Python 2.6 |
| 2008年11月17日 15:25:51 | techtonik | set | nosy:
+ techtonik messages: + msg75964 |
| 2008年01月05日 19:17:39 | christian.heimes | set | priority: normal -> low type: enhancement versions: + Python 2.6 |
| 2005年03月30日 09:05:42 | vds2212 | create | |