colorama icon indicating copy to clipboard operation
colorama copied to clipboard

Colorama.init() breaks pudb color themes

Open tartley opened this issue 4 years ago • 3 comments

Sounds like our bug: https://github.com/inducer/pudb/issues/381

tartley avatar Apr 03 '20 15:04 tartley

Hi Jonathan,

thanks for your quick reply over at pudb! I don't know whether there is an easier test case than the one with pudb mentioned above - that was the one where I stumbled over it.

Best wishes, M.

ricma avatar Apr 03 '20 15:04 ricma

Yeah, I suspect we'll confuse any software that does things with 'sys.stdout/err' other than call methods like .write(). I can't remember exactly how Colorama does its magic with sys.stdout, but I do remember it does something terrible. Something like substitute our own object, sys.stdout = ColoramasStdout(sys.stdout), which forwards to the real stdout for everything, but inserts our own logic around calls to .write(). I'm not surprised it causes problems.

tartley avatar Apr 03 '20 20:04 tartley

@tartley is there any workaround for resetting the color inside of pudb?

danihodovic avatar Dec 24 '20 15:12 danihodovic