colorama
colorama copied to clipboard
Catch writes to sys.stdout.buffer and sys.stderr.buffer as well
In some cases I have to write to sys.stdout.buffer
directly, which is not caught by colorama.
Maybe it's necessary to monkeypatch the (encoded) buffer object as well, if present (could be only Python 3.x, not sure though).
Workaround is to try to always write the color to sys.stderr
first