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.

classification
Title: Use '#!/usr/bin/env python' in scripts
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: fdrake Nosy List: effbot, fdrake, flight, tim.peters
Priority: normal Keywords: patch

Created on 2000-07-03 14:50 by flight, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
None flight, 2000-07-03 14:50 None
Messages (5)
msg33014 - (view) Author: Gregor Hoffleit (flight) Date: 2000-07-03 14:50
 
msg33015 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2000-07-05 20:49
Relying on environment variables not specifically defined in the CGI documentation is a bad idea, as they may not exist, or could expose bugs in the Web server.  For this reason, all CGI scripts (like the scripts modified by this patch) should use the exact path to the Python interpreter in the #! comment and should not rely on the "env" program (which is still not guaranteed to live in the same place on all systems).

This patch doesn't add anything to the reliability of the scripts; rejected.
msg33016 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-07-03 23:56
Accepted. and assigned to Fred Drake (just because he made the mistake of letting me know he's home <wink>).  Fred, I can't do a sanity-check of this on Windows, so how about just trying it on a system where hash-bang means something?  It's a very simple patch.
msg33017 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2000-07-04 09:11
note that both the affected files are CGI scripts.
I have a vague feeling that it's done this way on
purpose; if you install a CGI script, you should
make sure you know what "python" you're using...

wait a sec...

http://www.python.org/doc/FAQ.html#4.63

Note -- *don't* do this for CGI scripts. The $PATH
variable for CGI scripts is often very minimal, so
you need to use the actual absolute pathname of the interpreter.

-1 from me, in other words.
msg33018 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2000-07-04 11:57
reopened; see discussion on python-dev for
more info.
History
Date User Action Args
2022-04-10 16:02:03adminsetgithub: 32511
2000-07-03 14:50:40flightcreate