Repository navigation
Conversation
Resolving a pyenv shim looks for `.python-version` starting from `Path.cwd()`. That raises when the working directory was removed (FileNotFoundError) or, on illumos, when an ancestor can't be read (PermissionError), so `get_interpreter` failed (tox-dev#255). Fall back to `PWD` from the environment, pyenv's default start for its own `.python-version` search, so a local pin still wins over the global version. The unsearchable directory test now sets `PWD`, so it also passes where getcwd fails.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #255.
Path.cwd()raises in_active_versions, and thenget_interpreterfails while it resolves a pyenv shim. Delete the working directory and it'sFileNotFoundError(reproduced on Linux); on illumos it'sPermissionErrorwhen an ancestor can't be read (#255).So the local lookup now starts from
PWDinenv, where pyenv's own search starts too (${PYENV_DIR:=$PWD}inpyenv-version-file); a local pin still beats the globalversionfile.test_shim_unsearchable_directory_is_skippedsetsPWDtoo now, which should make it pass on illumos.The new test fails on
mainfor both errors and passes here, on Ubuntu (WSL) and on Windows 11. I don't have illumos; asitecustomizestood in for it, makingos.getcwdraise EACCES below an unreadable directory: with that, the unsearchable test fails onmainwith the error from the issue and passes here. Not run on illumos itself or on macOS.