Skip to content

fix: resolve stdout_path against cwd=, and raise QsvError from the probe - #7

Merged
jqnatividad merged 1 commit into
mainfrom
fix/review-followups
Oct 10, 2026
Merged

jqnatividad merged 1 commit into
mainfrom
fix/review-followups

Conversation

@jqnatividad

Copy link
Copy Markdown
Contributor

Follow-ups from a codebase review. Separate from #6; the two CHANGELOG [Unreleased] sections will need a trivial merge.

⚠️ Behavior change: relative stdout_path follows cwd=

With Qsv(cwd="/data"), run(..., stdout_path="out.csv") used to write ./out.csv relative to Python's working directory, while the input paths on argv resolved against /data. It now writes /data/out.csv, like a relative --output given to qsv. Existing code that relies on the old location gets no error; its file just lands elsewhere. Passing an absolute path keeps the old location. Suggest releasing as 0.3.0 and calling this out in the release notes.

Fixes

  • No bare ValueError from the capabilities probe. Unrecognized --version output now raises QsvError from capabilities (and from run when min_version is set). --capabilities JSON of an unexpected shape (TypeError/AttributeError, not only ValueError) now falls back to --version. Qsv and AsyncQsv share the parsing helpers.
  • Docstring: QsvError documented the argv attribute as args; it is args_run.

Known gaps (left as is)

  • If --capabilities returns valid JSON with an unparseable version (e.g. "dev") and min_version is set, parse_version still raises ValueError. The README wording covers only the --version case.
  • The new probe QsvError reports exit 0, because --version itself succeeded.

Tests

Six new tests (sync and async for each case) in tests/test_process.py; all fail without the source change. Full suite passes locally (67, macOS). ruff and mypy are clean, including --platform win32.

🤖 Generated with Claude Code

- A relative stdout_path is now resolved against the client's cwd=, like
  a relative --output given to qsv, instead of Python's working
  directory. Behavior change: output files of runs that combine cwd=
  with a relative stdout_path move.
- capabilities (and run with min_version) raise QsvError instead of a
  bare ValueError when --version output isn't recognized, and fall back
  to --version when --capabilities returns JSON of an unexpected shape.
  Qsv and AsyncQsv now share this probe logic.
- The QsvError docstring named the argv attribute args; it is args_run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jqnatividad
jqnatividad merged commit a02f88a into main Oct 10, 2026
16 checks passed
@jqnatividad
jqnatividad deleted the fix/review-followups branch October 10, 2026 17:46
@jqnatividad jqnatividad mentioned this pull request Oct 10, 2026
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

Successfully merging this pull request may close these issues.

1 participant