yugabyte/yugabyte-db

[YCQL] The `ycqlsh` script wrongly determines python 3.10 to be not appropriate

Open

#15.652 geöffnet am 12. Jan. 2023

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C (1.003 Forks)batch import
area/ycqlgood first issuekind/bugpriority/medium

Repository-Metriken

Stars
 (8.229 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 17T 21h) (92 gemergte PRs in 30 T)

Beschreibung

Jira Link: DB-5022

Description

Yugabyte version: version 2.17.2.0 build PRE_RELEASE revision adc244721431d1ab188d6e1aee11b98a298b629e build_type RELEASE built at 11 Jan 2023 14:38:01 CET (built from master branch)

I am using python version 3.10:

➜ pyenv global
3.10

➜ python --version
Python 3.10.8

When I start ycqlsh, it shows:

➜ ./bin/ycqlsh
No appropriate Python interpreter found.

But when I set python version 3.6, it does work:

➜ pyenv global 3.6

yugabyte-db on  master [!?] via △ v3.25.1 via 🐍 v3.6.15
➜ python --version
Python 3.6.15

➜ ./bin/ycqlsh
Connected to local cluster at 127.0.0.1:9042.
[ycqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
ycqlsh>

Analysis:

  • When YB is build using yb_release.sh, the ycqlsh client is located in /bin/ycqlsh.
  • This is a script that calls:
    • build-support/common-cli-env.sh
      • common-build-env.sh
    • "$YB_THIRDPARTY_DIR"/installed/common/cqlsh/bin/ycqlsh "$@"

Using set -x in the (last ycqlsh) script I can find that the python version check takes place in the last script:

++ get_python_version python3
++ interpreter=python3
+++ command -v python3
+++ python3 -c 'import os; print('\''{}.{}'\''.format(os.sys.version_info.major, os.sys.version_info.minor))'
++ version=3.10
++ echo 3.10
+ version=3.10
+ '[' -n 3.10 ']'
++ is_supported_version 3.10
++ version=3.10
++ '[' 3.10 = 3.6 ']'
++ '[' 3.10 '>' 3.6 ']'
++ '[' 3.10 = 2.7 ']'
++ echo unsupported

So version 3.10 is seen as a lower version than 3.6.

Contributor Guide