Repository navigation
Let the stdout guard read writes, not flushes - #11576
Conversation
test_no_direct_stdout_writes flags sys.stdout.write and sys.stdout.flush outside the progress helpers, and has failed on main since #11566, which flushes stdout and stderr before rerunning the installer it just installed. That flush is needed: the child writes to the same descriptors, so anything still buffered would land after its output. A flush emits nothing and cannot glue text onto the progress bar, which is what the guard exists for. It now matches write only; a direct write on the same line still fails it.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* Let the stdout guard read writes, not flushes test_no_direct_stdout_writes flags sys.stdout.write and sys.stdout.flush outside the progress helpers, and has failed on main since unslothai#11566, which flushes stdout and stderr before rerunning the installer it just installed. That flush is needed: the child writes to the same descriptors, so anything still buffered would land after its output. A flush emits nothing and cannot glue text onto the progress bar, which is what the guard exists for. It now matches write only; a direct write on the same line still fails it. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary
tests/python/test_install_python_stack.py::TestProgressLineNotes::test_no_direct_stdout_writesfails on main (be072ee2f) and inRepo tests (CPU, studio):Line 10982 came in with #11566. It flushes stdout and stderr before the installer reruns the new version of itself:
That flush is correct and needed. The guard exists so nobody copies
_progress()'ssys.stdout.writeidiom and glues text onto the progress bar (its docstring says so). A flush emits no characters and cannot do that. The matcher listedflushonly as the second half of that idiom. It now matcheswriteonly; the product is unchanged.Verification
TestProgressLineNotes: 14 passed (1 failed on main).sys.stdout.write("")fails the test at that line.