fix: pre-existing issues in server.py and common.py (raise_if_dead, has_minimum_version)#641
Open
fix: pre-existing issues in server.py and common.py (raise_if_dead, has_minimum_version)#641
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #641 +/- ##
=======================================
Coverage 46.58% 46.58%
=======================================
Files 22 22
Lines 2372 2372
Branches 390 390
=======================================
Hits 1105 1105
Misses 1098 1098
Partials 169 169 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
why: subprocess.check_call without stdout/stderr redirection inherits the
parent process's file descriptors, printing tmux output directly to
the terminal. Library code should not produce terminal noise.
what:
- Pass stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL to check_call
cd81d15 to
1cccc1d
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.
Summary
Three pre-existing issues surfaced during a fresh code review of PR #636. This PR addresses them as atomic commits against
master.common(fix[has_minimum_version]):has_minimum_versionwas callingget_version()twice, spawning two subprocesses for no reason. Now cached in a local variable.server(docs[raise_if_dead]):raise_if_deadhad noRaisessection in its docstring. BothTmuxCommandNotFound(missing binary) andCalledProcessError(server not running) are now documented.server(fix[raise_if_dead]):subprocess.check_callinraise_if_deadinherited the parent process's stdout/stderr, leakinglist-sessionsoutput to the terminal. Now redirected tosubprocess.DEVNULL.Test plan
uv run ruff check . --fix --show-fixes— cleanuv run ruff format .— no changesuv run mypy— no issues (60 source files)uv run py.test -x -q— 885 passed, 1 skipped