-
Notifications
You must be signed in to change notification settings - Fork 367
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
Output streaming erroneously disabled when hide
is in play
#637
Comments
Musings on the right way to implement that first solution:
|
Given how we've structured the code so far, option 1 there isn't actually trivial anyways, because |
Still needs docstring update and changelog entry
I think this can be considered a bugfix (despite the ever so small chance of backwards incompat breakage) so actually moving that to base on the 1.0 branch... |
Still needs docstring update and changelog entry
Ran into this as part of #682 too (insofar as the new asynchronous option also impacts hiding streams) and tackling it in that branch. Independently had settled on option 2 from above mental spew (only look at whether the argument had some non-default/None value, instead of the above commit's option 1 approach of "is it sys.stdout/err"), so that's good confirmation. |
Bewildered this hasn't come up before, but a co-worker was trying to make heavy use of
out_stream
and found thathide
turns off streaming entirely, vs my recollection that eghide='stdout'
orhide=True
only turn off the default shoveling to sys.stdout.However the code is too naive/"pure":
Runner._handle_output
.hide
arg, theoutput
stream, etc.output
stream default to sys.stdout, etc, are higher up - this method doesn't currently know or care how that is determined.hide
indicates this stream should be hidden, the step ofself.write_our_output()
to theoutput
stream is skipped.output
was the default-to-your-terminal stream or not.Obvious solutions:
_handle_output
or higher up and add a new kwarg to the former - test whether the user has actually overriddenout_stream
/err_stream
, and ignorehide
in that case.out_stream
/err_stream
have always been pitched/intended as "the way you would make stuff go somewhere besides the user's terminal", with watchers coming later and being more of a "stuff you might want to have happen in addition to streaming output to a terminal or log" feature, such as the prompt autoresponse it was built for.The text was updated successfully, but these errors were encountered: