News for hackers. Stuff that matters.
Re:Ubuntu announces 12.10 (Quantal Quetzal) Beta 1 by pserwylo on Thursday September 06, 2012 @08:51PM (#4487155)
I wonder if this will cause much strife. I run ArchLinux, for which the default /usr/bin/python is Python 3. Often I run into issues with (admittedly software not from the repos) which uses the

#!/usr/bin/python

shebang, and expects it to reference Python 2, thus causing breakage.

Re:Ubuntu announces 12.10 (Quantal Quetzal) Beta 1 by takluyver on Thursday September 06, 2012 @09:01PM (#4487184)
Ubuntu won't be changing that - /usr/bin/python will still mean Python 2. It just won't be installed by default (if they meet their goal, which looks doubtful for this cycle).
Re:Ubuntu announces 12.10 (Quantal Quetzal) Beta 1 by sp332 on Friday September 07, 2012 @08:32AM (#4488709)
Interesting, that's not recommended by python devs. Ubuntu follows the guideline of keeping /usr/bin/python as Python 2 (which will not be installed by default), and /usr/bin/python3 as Python 3.

ETA: Arch Linux actually did this before there was an "official" guideline. http://www.wefearchange.org/2012/04/python-3-on-desktop-for-...

Re:Ubuntu announces 12.10 (Quantal Quetzal) Beta 1 by pserwylo on Saturday September 08, 2012 @12:50AM (#4492277)
I guess the reason that I like Arch (new software releases quickly) also caused them to beat the official guideline here :)

Thanks for the pointer.

Re:Ubuntu announces 12.10 (Quantal Quetzal) Beta 1 by h00k on Thursday September 06, 2012 @10:38PM (#4487455)
There's always:

#!/usr/bin/env python

too

Re:Ubuntu announces 12.10 (Quantal Quetzal) Beta 1 by pilif on Friday September 07, 2012 @02:41AM (#4487906)
which btw wouldn't help at all with op's scenario of Python 2 scripts finding an unexpected Python 3 interpreter.
Re:Ubuntu announces 12.10 (Quantal Quetzal) Beta 1 by nnnnni on Friday September 07, 2012 @07:46AM (#4488578)
Exactly. Whenever a script is made, it should have #!/usr/bin/env interpreter# as the first line.

#!/usr/bin/env python2 #!/usr/bin/env python3

Explicitly declaring the required version fixes that problem. In arch, most of the PKGBUILDs will have a line to sed the explicit line into the file in place of the generic python line.