Skip to content

Commit 1dd6d2a

Browse files
committed
docs(run[deadline]) Note callback fires on stderr only
why: ``_wait_with_deadline`` now drains both ``stdout`` and ``stderr`` to prevent a chatty child from deadlocking on a full pipe, but the progress callback only fires for ``stderr`` chunks (matching the legacy non-timeout codepath). Without an explicit note, callers who pass ``log_in_real_time=True`` and expect ``stdout`` lines to surface in their callback will be surprised when the buffer is silent. what: - Add a Notes paragraph to ``_wait_with_deadline``'s docstring stating that the callback fires on ``stderr`` chunks only by design, and pointing callers who want streaming ``stdout`` toward redirecting the stream themselves instead of relying on the callback.
1 parent 0967d3d commit 1dd6d2a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/libvcs/_internal/run.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,15 @@ def _wait_with_deadline(
342342
``None`` when the corresponding pipe could not be put into non-
343343
blocking mode (Windows pipes, unusual fd types) -- in that case the
344344
caller should fall back to reading the pipe directly.
345+
346+
Notes
347+
-----
348+
The progress ``callback`` is invoked for ``stderr`` chunks only,
349+
matching the legacy non-timeout codepath. ``stdout`` is drained into
350+
the returned buffer to prevent the child from blocking on a full pipe,
351+
but its chunks are not forwarded to the callback in real time. Callers
352+
that want streaming ``stdout`` should redirect it themselves
353+
(e.g. ``stdout=`` to a file) rather than relying on ``callback``.
345354
"""
346355
sel = selectors.DefaultSelector()
347356
buffers: dict[t.IO[bytes], list[bytes]] = {}

0 commit comments

Comments
 (0)