ExecContext: Fix output handling #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jan/fix/20260610-lib-execcontext-put-fix-forgotten-input"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ExecContext: Fix output handling
This PR fixes miscellaneous issues with handling the output of a command run via ExecContext, most of them directly or indirectly introduced by commit
6db73873e7.lib.Result.repr() Fix missing f-qualifier
repr() tries to format a variable in an f-string without "f". Fix that.
lib.Result.repr(): Fix binary stdout exception
repr() tries to decode binary stdout as string and fails without a backup. Fix that.
lib.ExecContext|.Distro: Ignore stdout_str newline
Ignore newline at the end of Result.stdout_str if only one line of output is wanted from an executed shell command. The output of both uname and mktemp are used wrongly in that regard.
lib.ExecContext._put(): Clean up temporary file
_put() can leave temporary files behind if one of its shell commands fails, fix that.
lib.ExecContext._put(): Fix forgotten input
_put() doesn't put: An empty stdin is passed to tee, a regression introduced with
6db73873e7, fix that.