[Python-Dev] Bilingual scripts (original) (raw)

Toshio Kuratomi a.badger at gmail.com
Mon May 27 20:38:36 CEST 2013


On Sat, May 25, 2013 at 05:57:28PM +1000, Nick Coghlan wrote:

On Sat, May 25, 2013 at 5:56 AM, Barry Warsaw <barry at python.org> wrote: > Have any other *nix distros addressed this, and if so, how do you solve it?

I believe Fedora follows the lead set by our own makefile and just appends a "3" to the script name when there is also a Python 2 equivalent (thus pydoc3 and pyvenv). (I don't have any other system provided Python 3 scripts on this machine, though)

Fedora is a bit of a mess... we try to work with upstream's intent when upstream has realized this problem exists and have a single standard when upstream does not. The full guidelines are here:

http://fedoraproject.org/wiki/Packaging:Python#Naming

Here's the summary:

> It would be nice if we could have some cross-platform recommendations so > things work the same wherever you go. To that end, if we can reach some > consensus, I'd be willing to put together an informational PEP and some > scripts that might be of general use.

It seems to me the existing recommendation to use ``#!/usr/bin/env python`` instead of referencing a particular binary already covers the general case. The challenge for the distros is that we want a solution that ignores user level virtual environments. I think the simplest thing to do is just append the "3" to the binary name (as we do ourselves for pydoc) and then abide by the recommendations in PEP 394 to reference the correct system executable. I'd rather not have a bare 3 for the issues notes above. Something like py3 would be better.

There's still room for confusion when distributions have to push multiple versions of a package with scripts that fall into this category. Should the format be:

/usr/bin/foo2-py3 (My preference as it places the version next to the thing that it's a version of.)

or

/usr/bin/foo-py3-2 (Confusing as the 2 is bare. Something like /usr/bin/foo-py3-v2 is slightly better but still not as nice as the previous IMHO)

-Toshio -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20130527/beaf739f/attachment.pgp>



More information about the Python-Dev mailing list