Repository navigation
Skip empty and emulator-only process command lines - #105
Draft
nawaaaaaAaar wants to merge 2 commits into
Draft
nawaaaaaAaar wants to merge 2 commits into
nawaaaaaAaar wants to merge 2 commits into
Conversation
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.
Problem
POSIX shell discovery can abort on an ancestor with no command-line arguments: splatting the empty argument list into
_get_shell()raisesTypeError. A QEMU/Rosetta command without a following guest command instead raisesIndexError. 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 -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.ruff check src: 11 existing violations, identical on unchanged upstream and the patched tree.black --check src: existing formatting failure innt.py, also present on unchanged upstream.python -m build: sdist and wheel built.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.