Public bug reported:
$ lsb_release -rd
Description: Ubuntu 18.04.3 LTS
Release: 18.04
$ apt-cache policy cfget
cfget:
Installed: 0.19-1.1
Candidate: 0.19-1.1
Version table:
*** 0.19-1.1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
100 /var/lib/dpkg/status
EXPECTED:
$ cfget -C /etc/os-release UBUNTU_CODENAME
bionic
OBSERVED:
$ cfget -C /etc/os-release UBUNTU_CODENAME
File "/usr/bin/cfget", line 443
raise UserError, "No configuration files specified in %s" % cfgenv
^
SyntaxError: invalid syntax
DETAILS:
The system on which this exception was raised did not have python2 installed
prior to the installation of this package, as is standard for Ubuntu 18.04, but
did have the python3 binary registered via update-alternatives as the default
python interpreter accessed via `$ python` for compatibility with other
software that executes on python3 but expects to be able to invoke itself via
the `python` command.
The package was installed via apt without modification, and the only
warning that was raised with respect to the existence of a non-standard
state of the update-alternatives setting for the `python` command was
the following line:
update-alternatives: warning: forcing reinstallation of alternative
/usr/bin/python3.6 because link group python is broken
While I understand that manually registering the `python` command to
point to python3.6 comes with some measure of responsibility to
understand the limitations of the system, and I am pleased that the
installation did not override the manually-registered association, it
strikes me as incredibly naive to present a software package that
explicitly lists python2 as a dependency (that apt installs and ensures
is provided via the `python2` command) but assumes in its shebang line
(#!/usr/bin/python) that the `python` command will not be non-standard,
especially in the context of the decision to set python3 as the only
default version of python installed with releases at-or-beyond 18.04.
(I am aware that the official position on the registration of python3 as
`python` (as a means to permit packages, which are able to execute under
either python version, to execute properly on systems without python2
installed) is that such software should be updated to drop backwards
support for python2 and, concurrently, update its shebang declaration to
reference the python3 executable explicitly. This seems to me to be a
needlessly draconian policy in light of the availability of tools like
update-alternatives and the common availability of the version-explicit
python2 and python3 commands.)
If this software is too time consuming to quickly revise for python3 (to
remove the less-than-desirable dependency on python2), the attached
patch should ensure that sysadmins who have elected to configure their
servers running modern Ubuntu distros are at least somewhat protected
against future discovery of unpatched python2 security issues by
registering python3, via update-alternatives, as `python` are not
presented with unexpected syntax errors instead of expected package
functionality.
** Affects: cfget (Ubuntu)
Importance: Undecided
Status: New
** Patch added: "Clear specification of required python version for execution"
https://bugs.launchpad.net/bugs/1853499/+attachment/5306924/+files/explicit_py2.patch
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1853499
Title:
Python3-incompatible exception-handling syntax error
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cfget/+bug/1853499/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs