Azure / Azure/azure-cli-dev-tools

Using default Python env fails when looking for config

Offen
#355 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
91
Forks
134
Ø Merge
2 Std. 51 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli, devtools
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.