cleo
cleo copied to clipboard
Why progress-indicator defaults the output to standard error instead of standard output?
https://github.com/sdispater/clikit/blob/master/src/clikit/ui/components/progress_indicator.py#L31 https://github.com/sdispater/cleo/blob/master/cleo/ui/progress_indicator.py#L35
class ProgressIndicator(object):
def __init__(self, ...):
if isinstance(io, IO):
io = io.error_output
I could not infer the reasoning behind this. I would think stderr
should be empty if there is no error.
This is pretty common for progress bars. See tqdm:
Customisable progressbar decorator for iterators. Includes a default range iterator printing to stderr.
POSIX defines stderr as "for writing diagnostic output": https://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html
Notably, this does not say "for writing application errors." I would think the progress of the task you're doing could be considered "diagnostic output."
I believe the original question has been answered. For anyone not satisfied, please open a new issue.