3 ms·
Be nice if you'd make it explicit that it depends on Python 2 (change your hashbang to point to python2, or make it work in either runtime). Arch Linux defaults
by coldpie 14y ago
Be nice if you'd make it explicit that it depends on Python 2 (change your hashbang to point to python2, or make it work in either runtime). Arch Linux defaults to Python 3 these days.
- gleitz 14y agoI'm not familiar with the proper way to annotate that. How would I change the hashbang? #!/usr/bin/env python
- coldpie 14y agoI'm not an expert, but I believe just s/python/python2/. Also put it in the documentation as a requirement. Edit: Hee hee [aeikum@aeikum howdoi]$ howdoi use python2 on default python3 /usr/bin/env python2.7
- gleitz 14y agoMy worry is that not everyone will have python2.7 so I'd rather stick to "#!/usr/bin/env python". It would be great if this works but it doesn't #!/usr/bin/env python2
- geofft 14y agoIsn't that an Arch bug? Last I heard, there was consensus in the upstream Python community that /usr/bin/python should not be Python 3, which makes sense because Python 3 is deliberately incompatible with Python 2. Of course, that viewpoint might have changed. But still, even if upstream disagrees, I think it is the responsibility of the packagers not to break ABI compatibility in this way (just as they wouldn't ship OpenSSL 1.0 as libopenssl0.9.8.so). I'm pretty sure every script that uses Python 3 uses python3 in the shebang.
- coldpie 14y agoYou're talking about PEP 394[1]. It suggests that "python" point to either "python2" or "python3", depending on what ships with the distro by default or on the distro's stated goals. Arch tries to be as cutting edge as possible, even putting out new kernels within weeks after their release. It makes sense for Arch to begin pushing the boundaries here. There was a discussion on the arch-dev-public mailing list[2] recently that you might be interested in. In any case, I think it's clearly beneficial for every new Python application to make their version requirements explicit in the hashbang. [1] http://www.python.org/dev/peps/pep-0394/ http://www.python.org/dev/peps/pep-0394/ [2] https://mailman.archlinux.org/pipermail/arch-dev-public/2012-September/023558.html https://mailman.archlinux.org/pipermail/arch-dev-public/2012...
- geofft 14y agoCool, thanks for the pointers! I'm a little disappointed that Debian doesn't seem to be shipping the python2 symlink, which means that I can't switch to using that in my own code.