Skip to content

With path: version, python shim fails (but python3 works) (asdf v0.13) #206

@jacktose

Description

@jacktose

Provide environment information

OS:
Linux ad-user-ads-11.s.xx.xxx 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.2.37(1)-release

ASDF VERSION:
v0.13.1-0586b37

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/usr/lusers/jacktose/.asdf
ASDF_DIR=/usr/lusers/jacktose/.asdf
ASDF_CONFIG_FILE=/usr/lusers/jacktose/.asdfrc

ASDF INSTALLED PLUGINS:
python                       https://github.com/danhper/asdf-python.git master 5e277e2

To Reproduce

  1. Have a non-asdf python installation:
    $ /netops/local/python-3.9.2/bin/python3.9 -V
    Python 3.9.2
    
  2. Configure asdf to use it, with path: syntax:
    $ asdf local python path:/netops/local/python-3.9.2
    $ cat .tool-versions
    python path:/netops/local/python-3.9.2
    
  3. Check which python is used:
    $ asdf which python
    /usr/local/bin/python
    $ python -V
    Python 2.7.5
    
  4. Compare to python3:
    $ asdf which python3
    /netops/local/python-3.9.2/bin/python3
    $ python3 -V
    Python 3.9.2
    

Note that shims are fine:

$ which python
~/.asdf/shims/python
$ which python3
~/.asdf/shims/python3

And python works as expected for asdf-installed python:

$ asdf local python 3.9.15

$ cat .tool-versions
python 3.9.15

$ asdf which python
/usr/lusers/jacktose/.asdf/installs/python/3.9.15/bin/python

$ python -V
Python 3.9.15

$ asdf which python3
/usr/lusers/jacktose/.asdf/installs/python/3.9.15/bin/python3

$ python3 -V
Python 3.9.15

Describe the Bug

When setting the python version to a non-asdf python3 with a path: entry, the python shim calls the system python instead of the configured one. The python3 shim calls the configured one as expected.

Expected Behaviour

The python shim should call the configured python binary, as the python3 shim does.

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