fix: report stderr as None when it is merged into stdout - #8
Merged
cuinixam merged 2 commits intoSep 10, 2026
Merged
Conversation
Contributor
Author
|
The second commit is unrelated to the fix: pypeline-runner now rejects an unquoted python_version in pypeline.yaml, which fails lint and all test jobs on every PR and on main. Happy to split it into its own PR if you prefer. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
execute(handle_errors=False)returns aCompletedProcesswhose.stderris always empty, whatever the command wrote. Everything the command printed is in.stdout.""claims the command wrote nothing to stderr, so code likelogger.warning(f"failed:\n{result.stderr}")reads as correct and stays permanently blank.Why this fix
The streams are merged on purpose (
stderr=subprocess.STDOUT), which keeps the progress and error lines in chronological order. That behaviour is right and stays.Only the reported value is wrong. There is no second pipe to read, so
stderrkeeps its initial"". Setting that initial value toNonefixes it:Noneis what the standard library means by "not captured", and it is what theprint_output=Falsepath already returned viacommunicate()— the three execution paths simply disagreed with each other.The docstrings now say that stderr is merged into stdout and callers read
.stdout.