-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
#4597: tee-stdio capture method #6315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall excellent patch, really solid (good docs, tests, everything).
I've left a few suggestions inline.
Added the requested test and got all checks passing :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work, upon rereading the full pr with docs and all, i realize that tee-sys
might be a better name as it leaves open the creation of a symmetric tee-fd
if we ever figure a reasonable implementation for that
Yeah, this should definitely be But I think it makes more sense as a separate option that gets handled by (In #4597 it was mentioned to be more tricky for fds, but it is done here by just writing to the orig handler anyway (which likely also works for the fd method then).) |
Alrighty swapped name to tee-sys |
@blueyed fd-tee has to have a completely different solution, as it has to work for non python and subprocesses |
My thought/idea was that MultiCapture would just call through to |
@blueyed that only works for python level file objects (its not enough for a fd) |
Thanks again @csm10495! I've added a link to the docs in the changelog entry and rebased/squashed the commits. 👍 We should merge once CI passes. |
Thanks! This is a really useful feature. |
Thanks for submitting a PR, your contribution is really appreciated!
Here is a quick checklist that should be present in PRs.
Target the
features
branch for new features, improvements, and removals/deprecations.Include documentation when adding new features.
Include new tests or update existing tests when applicable.
Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
Create a new changelog file in the
changelog
folder, with a name like<ISSUE NUMBER>.<TYPE>.rst
. See changelog/README.rst for details.Add tee-stdio capture mechanism to allow both live printing and capturing of test output.
AUTHORS
in alphabetical order.