Releases: netinvent/command_runner
command (runner) & conquer
Major release v1.2.0
This release is a major refactor of the stdout capture methods employed within command_runner.
So we jump from v0.7.0 to v1.2.0 since we have a major rework, and minor fixes too.
Since we include a critical fix, everybody is encouraged to migrate to this version.
Critical fixes
- There was a quite rare but annoying issue where the process finished, but there was still output to read in the pipe reader queue, rendering partial outputs. This has been fully refactored, and a test with 2500 rounds of file reading was added
Features
- There are now two distinct methods to capture output
- Spawning a thread to enforce timeouts, and using process.communicate() (monitor method)
- Spawning a thread to readlines from stdout pipe to an output queue, and reading from that output queue while enforcing timeouts (polller method)
- On the fly output (
live_output=True
) option is now explicit (uses poller method only) - Returns partial stdout output when timeouts are reached
- Returns partial stdout output when CTRL+C signal is received (only with poller method)
Misc
- Adds a default 16K stdout buffer
- Default command execution timeout is 3600s (1 hour)
- Highly improved tests
- All tests are done for both capture methods
- Timeout tests are more accurate
- Added missing encoding tests
- 2500 rounds of file reading and comparaison are added to detect rare queue read misses
Fixes
- Use process signals in favor of direct os.kill API to avoid potential race conditions when PID is reused too fast
- Allow full process subtree killing on Windows & Linux, hence not blocking multiple commands like
echo "test" && sleep 100 && echo "done"
- Windows does not maintain an explicit process subtree, so we runtime walk processes to establish the child processes to kill. Obviously, orphaned processes cannot be killed that way.-
The windows GUI
This is a bugfix release that adresses a problem where Windows GUI applications console output cannot be read properly, preventing the timeout to work, since we're stuck reading.
We introduced a threaded pipe reader, which may be stopped regardless of read state.
Keep it working more
This is a quick maintenance release that mainly streamlines packaging, and also fixes a possible encoding issue where command_runner may fail under Python <=3.4 when running executables within Powershell containing non unicode output.
keep_it_working
This is a simple release that fixes the setup.py issue with Python 2.7.
make_it_work
This is essentially a release to address various testing issues on github actions, adding windows test matrix and expanding tests in general.
The elevation library still needs proper tests written for it.
There's still a small bugfix that made it into this release:
- Added a check to prevent using command_runner option
windows_no_window
below Python 3.7 or when not running on windows
make_it_simple
This is the first public release of command_runner and elevate.