Azure / Azure/azure-cli-dev-tools

Using default Python env fails when looking for config

Ouverte
#355 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
91
Forks
134
Merge moyen
2 h 51 min
PR mergées (30 j)
1

Description

Found an edge case when I went and skipped some of the setup steps, and did not create a dedicated Python env (particularly while creating a docker container that is already dedicated to the project).

```shell
pip install --upgrade pip
pip install azdev
azdev setup
```

```
Traceback (most recent call last):
File "/home/codespace/.python/current/bin/azdev", line 8, in
sys.exit(main())
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/azdev/__main__.py", line 39, in main
config_dir=get_azdev_config_dir())
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/azdev/utilities/config.py", line 24, in get_azdev_config_dir
_, env_name = os.path.splitdrive(get_env_path())
File "/usr/local/python/3.10.4/lib/python3.10/posixpath.py", line 134, in splitdrive
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
```

https://github.com/Azure/azure-cli-dev-tools/blob/eee6d32a6653d639d01a23481063675f175e8b41/azdev/utilities/config.py#L24

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start with azdev/utilities/config.py at get_azdev_config_dir and get_env_path, then reproduce the reported pip install and azdev setup commands in a default Python environment. Done means azdev setup no longer raises the NoneType traceback when no dedicated environment was created.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
cli, devtools
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.