{"id":22418,"library":"subprocrunner","title":"subprocrunner","description":"A wrapper library for Python's subprocess module that enhances readability and error handling. Current version 2.0.1 runs on Python >=3.7 with monthly/bimonthly releases.","status":"active","version":"2.0.1","language":"python","source_language":"en","source_url":"https://github.com/thombashi/subprocrunner","tags":["subprocess","wrapper","shell","command-execution"],"install":[{"cmd":"pip install subprocrunner","lang":"bash","label":"Stable release"}],"dependencies":[],"imports":[{"note":"Aliasing is unnecessary; the class is already short.","wrong":"from subprocrunner import SubprocessRunner as SR","symbol":"SubprocessRunner","correct":"from subprocrunner import SubprocessRunner"}],"quickstart":{"code":"from subprocrunner import SubprocessRunner\n\nrunner = SubprocessRunner('echo Hello, world!')\nrunner.run()\nprint(runner.stdout)","lang":"python","description":"Run a shell command and capture stdout."},"warnings":[{"fix":"Update code from `returncode, stdout, stderr = runner.run()` to `runner.run(); returncode, stdout, stderr = runner.returncode, runner.stdout, runner.stderr`.","message":"In version 2.0.0, the `run()` method no longer returns a tuple (returncode, stdout, stderr). It now returns a `SubprocessRunner` instance. Access output via attributes `returncode`, `stdout`, `stderr`.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Use `runner.run(raise_exception=False)` to handle errors manually.","message":"By default, `run()` raises `CalledProcessError` for non-zero exit codes. Set `raise_exception=False` to suppress this.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `pip install subprocrunner`.","cause":"Library not installed.","error":"ModuleNotFoundError: No module named 'subprocrunner'"},{"fix":"Call `runner.run()` before accessing `runner.stdout`.","cause":"Trying to access stdout before running the command.","error":"AttributeError: 'NoneType' object has no attribute 'stdout'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}