Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using default Python env fails when looking for config #355

Open
dciborow opened this issue Feb 25, 2023 · 1 comment
Open

Using default Python env fails when looking for config #355

dciborow opened this issue Feb 25, 2023 · 1 comment

Comments

@dciborow
Copy link
Contributor

dciborow commented Feb 25, 2023

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).

pip install --upgrade pip
pip install azdev
azdev setup
Traceback (most recent call last):
  File "/home/codespace/.python/current/bin/azdev", line 8, in <module>
    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

_, env_name = os.path.splitdrive(get_env_path())

@dciborow
Copy link
Contributor Author

dciborow commented Feb 25, 2023

Have proposed fix here.
#356

The code already contains a clause to return a value if the env_name was not determined, but the code is currently unreachable.

if not env_name:
return azdev_dir

Adding this if statement prevents the program from failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant