Public bug reported:

In order to deal with the fact that users often modify /usr/bin/python 
DistUpdgradeControler.py attempts to verify it is set to the correct version:
...
 fs_default_version = os.readlink('/usr/bin/python')
 except OSError as e:
                logging.error("os.readlink failed (%s)" % e)
                return False
            if not fs_default_version in (expected_default, 
os.path.join('/usr/bin', expected_default)):
...

This check fails to account for setups using update-alternatives. In
this case /usr/bin/python always points to another symlink ( i.e
/etc/alternatives/python). This makes the above check always fail
regardless of the python version actually running.

sys.version_info should be used instead as it makes no assumptions about
how python was invoked.

"%s.%s.%s"
%(sys.version_info[0],sys.version_info[1],sys.version_info[2])"%s.%s.%s"
%(sys.version[0],sys.version_info[1],sys.version_info[2])

Yields the version string (i.e '2.7.15') for the running python
interpreter.

** Affects: ubuntu-release-upgrader (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: dist-upgrade

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1798872

Title:
  _pythonSymlinkCheck fails to account for use of update-alternitives

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1798872/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to