[Python-Dev] Bilingual scripts

Barry Warsaw barry at python.org
Fri May 24 21:56:29 CEST 2013

Here's something that seems to come up from time to time in Debian.

Take a Python application like tox, nose, or pyflakes.  Their executables work
with both Python 2 and 3, but require a #! line to choose which interpreter to

When we add Python 3 support in Debian for such a script, all the library
installations are handled just fine, but we have conflicts about what to name
the thing that lands in /usr/bin.  Do we have /usr/bin/pyflakes and
/usr/bin/pyflakes3?  Do we call the latter py3flakes (as has been convention
with some other scripts, but which breaks locate(1))?  Do we simply remove the
/usr/bin scripts and encourage people to use something like `$python -m nose`?

One interesting recent suggestion is to create a shell driver script and make
that thing accept --py3 and --py2 flags, which would then select the
appropriate interpreter and invoke the actual Python driver.  There are some
technical details to iron out with that, but there's some appeal to it.

Have any other *nix distros addressed this, and if so, how do you solve it?
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.

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

More information about the Python-Dev mailing list