fix(pyvolca): don't mistake a volca directory for the engine binary#184
Merged
Conversation
Server._find_binary probed `Path(self.binary).exists()`, which is true for a directory. Running a script from a source checkout that has a `volca/` package directory in the working tree returned that directory as the binary; Popen then spawned an unexecutable path and start() hung until the wait timeout. Check for a file (`is_file()`) at both the explicit-binary and dev-tree fallbacks. Adds tests/test_server.py covering the shadowing case. Cuts pyvolca 0.7.1 (fix only; README compat block regenerated).
9d7f2f2 to
965702e
Compare
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.
Running a pyvolca script from a source checkout that has a
volca/package directory in the working tree leftServerunable to start:_find_binaryusedPath(self.binary).exists(), which matches a directory, so it returned that directory as the binary.Popenthen spawned an unexecutable path andstart()blocked until the wait timeout instead of using the downloaded binary.The lookup now checks for a file (
is_file()) at both the explicit-binary and dev-tree fallbacks, so a same-named directory no longer shadows the real binary. Addstests/test_server.pyfor the shadowing case.Ships as pyvolca 0.7.1 (fix only). The README compatibility block is regenerated to match the version bump; full suite green (183 passed, 7 skipped).