[Bug 2015243] Re: py3versions doesn't follow symlinks (like realpath)
Matthias Klose
2015243 at bugs.launchpad.net
Mon Jan 15 09:41:05 UTC 2024
The python3 symlink is not meant to be handled by alternatives.
** Changed in: python3-defaults (Ubuntu)
Status: New => Invalid
--
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:
Invalid
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