Skip to content

function default_version in py3versions.py fails if os.readlink('/usr/bin/python3') returns a link #1

Description

@gneiss15

When upgrading python3-twisted (ubuntu 18.04) I got the error:
ValueError: the symlink /usr/bin/python3 does not point to the python3 default version. It must be reset to point to python3.6

This is, because I had installed alternatives to python3.6.
When doing this the symlink '/usr/bin/python3' points to '/etc/alternatives/python3' which in turn points to '/usr/bin/python3.6'.

So the code of the function 'default_version' is (at least) incomplete.

My sugestion:
Insert the following code before the comment '# consistency check' (Line 146):

while os.path.islink(_default_version):
    _default_version = os.readlink(_default_version)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions