-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Description
In _confirm_install_r_packages() (src/soundscapy/r_wrapper/_r_wrapper.py), the try/except EOFError block only catches EOFError from input(). If print() raises BrokenPipeError (e.g. in a redirected-stdout environment like python -c "..." | head), the exception propagates uncaught through the dependency-check path, crashing what should be a graceful "should we install?" prompt.
Reproduction
python -c "import soundscapy.spi" | head -1
# BrokenPipeError propagates from print() inside _confirm_install_r_packagesFix
Broaden the caught exception to cover OSError (which BrokenPipeError is a subclass of):
try:
print(...)
response = input("Install them now via soundscapy? [y/N] ").strip().lower()
except (EOFError, OSError):
pass
else:
return response in ("y", "yes")Notes
- Found during code review of PR fix: R wrapper cleanup, DataFrame mutation bug, test coverage and docs #127 but left unfixed as unconfirmed/low-priority
- Only reachable interactively (when
sys.stdin.isatty()is True), which limits the blast radius - The
SOUNDSCAPY_AUTO_INSTALL_Renv var bypasses this path entirely for CI/scripts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels