Ravi1G / codejam-commandline

Automatically exported from code.google.com/p/codejam-commandline
Apache License 2.0
0 stars 0 forks source link

#!/usr/bin/python2 should be replaced with #!/usr/bin/env python #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to execute any of the python files

What is the expected output? What do you see instead?

The program runs.

/usr/bin/python2: bad interpreter: No such file or directory

What version of the product are you using? On what operating system?

1.0-beta2, Ubuntu 11.04

Please provide any additional information below.

PEP-394 specifies the presence of /usr/bin/python2 interpreter, but it's two 
months old, so it's not in most distributions-- at least, not Ubuntu 11.04.

Original issue reported on code.google.com by kekn...@gmail.com on 7 May 2011 at 1:09

GoogleCodeExporter commented 9 years ago
+1 this also fails to run "out of the box" on Mac OS X 10.6.7 even though 
python is included.

Original comment by csc...@gmail.com on 7 May 2011 at 4:56

GoogleCodeExporter commented 9 years ago
+1 Also more convenient for people who are running multiple versions of python 
and use a modified PATH to specify a default, or have installed python in an 
alternate location (e.g. their homedir).

Original comment by sumu...@gmail.com on 8 May 2011 at 4:07

GoogleCodeExporter commented 9 years ago
Sure, I can make that change, it should be available for the next release. Just 
a question, is "/usr/bin/env python2" good too? I would like to make explicit 
that python2 is required, the tool will not run properly in python3 and I would 
like to prevent it running in python3 by accident.

Original comment by jor...@google.com on 10 May 2011 at 1:17

GoogleCodeExporter commented 9 years ago

Original comment by jor...@google.com on 10 May 2011 at 1:23

GoogleCodeExporter commented 9 years ago
Changing "#!/usr/bin/python2" for "#!/usr/bin/env python2".

Original comment by jor...@google.com on 12 May 2011 at 6:54

GoogleCodeExporter commented 9 years ago
This was fixed and is available in the svn repository and in the 1.0-beta3 
version.

Original comment by jor...@google.com on 23 May 2011 at 9:37

GoogleCodeExporter commented 9 years ago
That didn't fix anything... the problem is that most distros don't have any 
python2 executables in the PATH, so "#!/usr/bin/env python2" is as useless as 
"#!/usr/bin/python2".

"#!/usr/bin/env python" would work.

Original comment by kekn...@gmail.com on 24 May 2011 at 4:26

GoogleCodeExporter commented 9 years ago
But I really don't want to put a generic python and risk people running it with 
python3 by accident. I'll add a script to change all the shebang lines to 
whatever you want (and that one will have "#!/usr/bin/env python" by default.

Original comment by jor...@google.com on 24 May 2011 at 6:56

GoogleCodeExporter commented 9 years ago
The script is almost ready, using it you will be able to run:

./tools/update_hashbangs.py -r "/usr/bin/env python" <cmdline_path>

And that will change all the hashbangs to "#!/usr/bin/env python". The script 
should be in the svn within a couple of days.

Original comment by jor...@google.com on 24 May 2011 at 10:26

GoogleCodeExporter commented 9 years ago

Original comment by jor...@google.com on 3 Jun 2011 at 4:07