GNU bug report logs -
#45655
Please use 'python3' command instead of 'python'
Previous Next
Reported by: Balint Reczey <balint.reczey <at> canonical.com>
Date: Mon, 4 Jan 2021 15:50:02 UTC
Severity: normal
Tags: fixed
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> 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’.
This bug report was last modified 4 years and 188 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.