Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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).


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-...


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.


There's always:

#!/usr/bin/env python

too


which btw wouldn't help at all with op's scenario of Python 2 scripts finding an unexpected Python 3 interpreter.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: