[Bug 2015243] Re: py3versions doesn't follow symlinks (like realpath)

Ubuntu Foundations Team Bug Bot 2015243 at bugs.launchpad.net
Tue Apr 4 16:25:36 UTC 2023


The attachment "py3versions.patch" seems to be a patch.  If it isn't,
please remove the "patch" flag from the attachment, remove the "patch"
tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the
team.

[This is an automated message performed by a Launchpad user owned by
~brian-murray, for any issues please contact him.]

** Tags added: patch

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

Title:
  py3versions doesn't follow symlinks (like realpath)

Status in python3-defaults package in Ubuntu:
  New

Bug description:
  In case if we have more than one python version and manage them by update-alternatives, the path to the python binary looks like:
  root at devvm-14-143:~# ls -la /usr/bin/python3
  lrwxrwxrwx 1 root root 25 Apr  4 08:11 /usr/bin/python3 -> /etc/alternatives/python3
  root at devvm-14-143:~# ls -la /etc/alternatives/python3
  lrwxrwxrwx 1 root root 18 Apr  4 08:11 /etc/alternatives/python3 -> /usr/bin/python3.8

  So even we use the correct default version of python3 (like in Focal
  it is python3.8) py3version will fail

  root at devvm-14-143:~# py3versions -d
  py3versions: the symlink /usr/bin/python3 does not point to the python3 default version. It must be reset to point to python3.8

  This caused due to os.readlink doesn't follow multiply symlinks, so I
  suggest to use Path from pathlib.

  I have attached patch with suggested changes.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/2015243/+subscriptions




More information about the foundations-bugs mailing list