You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this old bug report. In the described scenario (piping output from colorama into 'head', it seems like the correct behavior would be to catch this exception and silently exit with value 0.
Are there cases where that is not the correct behavior on catching a BrokenPipeError?
I don't see how this has anything to do with colorama? The exception is being raised by Python itself; colorama only shows up in the traceback because the output is going through it. There's probably some subtle difference in when buffered output gets flushed depending on whether colorama is enabled or not, that happens to tickle the issue in this case, but the underlying issue is independent.
Anyway with the new just_fix_windows_console API, colorama won't touch stdout when it's a pipe, so switching to that should take care of this in any case.
Originally reported at Azure/azure-cli#13413
Colorama fails if output is redirected to
head
command.test.py:
Output:
The text was updated successfully, but these errors were encountered: