ExecContext: Fix output handling #9

Merged
Jan Lindemann merged 5 commits from jan/fix/20260610-lib-execcontext-put-fix-forgotten-input into master 2026-06-10 13:08:29 +02:00 AGit

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.

# 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.

__repr__() tries to format a variable in an f-string without "f". Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>

__repr__() tries to decode binary stdout as string and fails without a backup. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>

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.

Signed-off-by: Jan Lindemann <jan@janware.com>

_put() can leave temporary files behind if one of its shell commands fails, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
lib.ExecContext._put(): Fix forgotten input
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m12s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m10s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m22s
CI / Packaging test (push) Successful in 0s
422f09a0b4

_put() doesn't put: An empty stdin is passed to tee, a regression introduced with 6db73873e7, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-06-10 13:01:52 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janware/jw-pkg!9
No description provided.