Skip to content

Skip empty and emulator-only process command lines - #105

Draft
nawaaaaaAaar wants to merge 2 commits into
sarugaku:masterfrom
nawaaaaaAaar:fix/oss-track04-shellingham
Draft

nawaaaaaAaar wants to merge 2 commits into
sarugaku:masterfrom
nawaaaaaAaar:fix/oss-track04-shellingham

Conversation

@nawaaaaaAaar

Copy link
Copy Markdown

Problem

POSIX shell discovery can abort on an ancestor with no command-line arguments: splatting the empty argument list into _get_shell() raises TypeError. A QEMU/Rosetta command without a following guest command instead raises IndexError. Neither condition should prevent checking later ancestors for a usable shell.

Reproduced with regression fixtures against unchanged upstream 926401c4543b84f9f579932d30fb52a104639398: five new cases fail with those exceptions, while the empty-string control and existing detection test pass.

Change

Skip empty process argument lists and treat emulator-only command lines as unrecognised. Continue normal ancestor traversal without changing shell matching, process collection, or depth limits.

The tests cover empty argument lists, an empty-string control, emulator-only ancestors followed by bash, and the direct QEMU/Rosetta helper cases.

Validation

  • Python 3.12 and 3.14: python -m pytest -q: 7 passed on each (upstream baseline: 1).
  • ruff check --isolated --select E4,E7,E9,F src/shellingham/posix/__init__.py tests/test_posix.py: passed.
  • black --check src/shellingham/posix/__init__.py: passed.
  • Full configured ruff check src: 11 existing violations, identical on unchanged upstream and the patched tree.
  • Full black --check src: existing formatting failure in nt.py, also present on unchanged upstream.
  • python -m build: sdist and wheel built.
  • Installed-wheel smoke test: live bash detection succeeds.
  • git diff --check: passed.

Linux tested locally; Windows, macOS, and real QEMU/Rosetta execution were not run locally. Emulator edge cases are covered by deterministic fixtures. Open issues and PRs were checked; this does not overlap the busybox or byte-encoding proposals.

AI assistance: prepared and tested by Perplexity Computer. No human-review attestation is implied.

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