Subject: bug#45655: Please use 'python3' command instead of 'python'

From: Pankaj Jangid <[email-masked]>
Date: Mon, 11 Jan 2021 10:47:59 +0530

Stefan Monnier <[email-masked]> writes:

> In contrast the question at hand is "which version of Python should one
> start when the user wants to run a Python subprocess".  I think it's
> reasonable to consider that *if* there is a `python` executable in
> $PATH, it makes sense to considered it as the preferred version
> of Python.

We need to consider multiple scenarios:

1. Both, ‘python’ as well as ‘python3’ executables, are in PATH.
   1.1 ‘python’ pointing to Python v2
   1.2 ‘python’ pointing to Python v3

2. Only ‘python’ is in PATH
   - This is surely Python v2 otherwise ‘python3’ will also be in PATH

3. Only ‘python3’ is in PATH

In (2) and (3), we have only one choice to pick. The point of discussion
are (1.1) and (1.2).

In (1.2), user has somehow customized the system PATH and made Python v3
as default. So we can obey what the user wants - pick
‘python’. Although, I don’t know if there is a standard prescription on
‘python2’ executable, but on some systems this is available (macOS). In
case of (1.2), we can simply pick ‘python’.

(1.1) is the case where both Python v2 and Python v3 are installed and
we don’t know what the user wants. ‘python’ and ‘python3’ (and may be
‘python2’) are in PATH.

In (1.1), my opinion is that we should pick the version which is
officially supported by the Python Community - pick ‘python3’.